SSL settings

This commit is contained in:
Martin Mahner 2013-05-28 22:35:01 +00:00
parent 668c2d71f4
commit a7afa9a944
3 changed files with 26 additions and 15 deletions

View file

@ -5,15 +5,24 @@ upstream app_server {
server {
listen 80;
server_name dpaste.de dpaste.org;
include /srv/dpaste.de/src/dpaste/server/nginx_server.conf;
# Do not redirect to SSL for API calls (some clients dont support
# this automatically)
location /api {
include /srv/dpaste.de/src/dpaste/server/nginx_server_appforward.conf;
}
location / {
rewrite ^ https://$server_name$request_uri? permanent;
}
}
server {
listen 443;
server_name dpaste.de;
ssl on;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
ssl_certificate /srv/dpaste.de/var/ssl/dpaste_de_unified.crt;
ssl_certificate_key /srv/dpaste.de/var/ssl/dpaste_de.key;
include /srv/dpaste.de/src/dpaste/server/nginx_server.conf;
}
@ -22,8 +31,8 @@ server {
listen 443;
server_name dpaste.org;
ssl on;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
ssl_certificate /srv/dpaste.de/var/ssl/dpaste_org_unified.crt;
ssl_certificate_key /srv/dpaste.de/var/ssl/dpaste_org.key;
include /srv/dpaste.de/src/dpaste/server/nginx_server.conf;
}

View file

@ -1,21 +1,15 @@
server_name dpaste.de dpaste.org;
error_log /srv/dpaste.de/var/nginx.error.log;
keepalive_timeout 5;
client_max_body_size 4G;
location /media/ {
alias /srv/dpaste.de/var/media/;
}
location /static/ {
alias /srv/dpaste.de/var/static/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_buffering off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
include /srv/dpaste.de/src/dpaste/server/nginx_server_appforward.conf;
}

View file

@ -0,0 +1,8 @@
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_buffering off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}