Further nginx improvements

This commit is contained in:
Martin Mahner 2014-12-12 19:16:51 +00:00
parent 39e687dbce
commit a546cc4d59

View file

@ -12,7 +12,10 @@ log_format combined_port '$remote_addr - $remote_user [$time_local] '
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
server { server {
listen 80; listen 80;
server_name ~(www\.)?dpaste\.(de|org); server_name dpaste.de
www.dpaste.de
dpaste.org
www.dpaste.org;
location / { location / {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
@ -24,7 +27,7 @@ server {
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
server { server {
listen 443 ssl; listen 443 ssl spdy;
server_name dpaste.org www.dpaste.org; server_name dpaste.org www.dpaste.org;
ssl_certificate /srv/dpaste.de/var/ssl/dpaste_org_unified.crt; ssl_certificate /srv/dpaste.de/var/ssl/dpaste_org_unified.crt;
@ -38,7 +41,7 @@ server {
} }
server { server {
listen 443 ssl; listen 443 ssl spdy;
server_name dpaste.de www.dpaste.de; server_name dpaste.de www.dpaste.de;
ssl_certificate /srv/dpaste.de/var/ssl/dpaste_de_unified.crt; ssl_certificate /srv/dpaste.de/var/ssl/dpaste_de_unified.crt;
@ -59,7 +62,7 @@ server {
error_log /srv/dpaste.de/var/nginx.error.log; error_log /srv/dpaste.de/var/nginx.error.log;
keepalive_timeout 5; keepalive_timeout 5;
client_max_body_size 4G; client_max_body_size 2M;
location /media/ { location /media/ {
alias /srv/dpaste.de/var/media/; alias /srv/dpaste.de/var/media/;
@ -74,10 +77,8 @@ server {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_redirect off; proxy_redirect off;
proxy_buffering off; proxy_buffering off;
if (!-f $request_filename) {
proxy_pass http://app_server; proxy_pass http://app_server;
break; break;
} }
}
} }