Skip to content

Commit

Permalink
Add sample nginx config with latest SSL cipher recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
esbullington committed Oct 29, 2014
1 parent 3330016 commit be94e37
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions config/nginx.conf
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;

}
}
}

0 comments on commit be94e37

Please sign in to comment.