-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sample nginx config with latest SSL cipher recommendations
- Loading branch information
1 parent
3330016
commit be94e37
Showing
1 changed file
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# You should look at the following URL's in order to grasp a solid understanding | ||
# of Nginx configuration files in order to fully unleash the power of Nginx. | ||
# http://wiki.nginx.org/Pitfalls | ||
# http://wiki.nginx.org/QuickStart | ||
# http://wiki.nginx.org/Configuration | ||
# | ||
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. | ||
|
||
worker_processes 1; | ||
|
||
events { | ||
|
||
worker_connections 1024; | ||
|
||
} | ||
|
||
http { | ||
|
||
sendfile on; | ||
|
||
gzip on; | ||
gzip_http_version 1.0; | ||
gzip_proxied any; | ||
gzip_min_length 500; | ||
gzip_disable "MSIE [1-6]\."; | ||
gzip_types text/plain text/xml text/css | ||
text/comma-separated-values | ||
text/javascript | ||
application/x-javascript | ||
application/atom+xml; | ||
|
||
# SSL settings | ||
ssl_certificate /etc/ssl/certs/yourcert_com.crt; | ||
ssl_certificate_key /etc/ssl/private/yourkey_com.key; | ||
|
||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM; | ||
ssl_prefer_server_ciphers on; | ||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_timeout 10m; | ||
|
||
# Configuration containing list of application servers | ||
upstream uwsgicluster { | ||
|
||
server 127.0.0.1:8080; | ||
# server 127.0.0.1:8081; | ||
# .. | ||
# . | ||
|
||
} | ||
|
||
# Configuration for Nginx | ||
server { | ||
|
||
# Running port | ||
listen 80; | ||
|
||
# Settings to by-pass for static files | ||
location ^~ /static/ { | ||
|
||
# Example: | ||
# root /full/path/to/application/static/file/dir; | ||
root /app/static/; | ||
|
||
} | ||
|
||
# Serve a static file (ex. favico) outside static dir. | ||
location = /favico.ico { | ||
|
||
root /app/favico.ico; | ||
|
||
} | ||
|
||
# Proxying connections to application servers | ||
location / { | ||
|
||
include uwsgi_params; | ||
uwsgi_pass uwsgicluster; | ||
|
||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
|
||
} | ||
} | ||
} |