Commit f3b0f0822be71ce59a4a7c591243899bd844075f
1 parent
389697e281
Exists in
master
Exposed real remote address to django
Showing 1 changed file with 1 additions and 0 deletions Inline Diff
nginxconf/flashy.cards
View file @
f3b0f08
upstream backend_production { | 1 | 1 | upstream backend_production { | |
# server unix:/tmp/flashy.sock; | 2 | 2 | # server unix:/tmp/flashy.sock; | |
server localhost:7001; | 3 | 3 | server localhost:7001; | |
} | 4 | 4 | } | |
5 | 5 | |||
server { | 6 | 6 | server { | |
server_name flashy.cards; | 7 | 7 | server_name flashy.cards; | |
listen 443 ssl; | 8 | 8 | listen 443 ssl; | |
location / { | 9 | 9 | location / { | |
root /srv/flashy.cards/; | 10 | 10 | root /srv/flashy.cards/; | |
} | 11 | 11 | } | |
12 | 12 | |||
location ^~ /static { | 13 | 13 | location ^~ /static { | |
root /srv/; | 14 | 14 | root /srv/; | |
access_log off; | 15 | 15 | access_log off; | |
expires 30d; | 16 | 16 | expires 30d; | |
} | 17 | 17 | } | |
18 | 18 | |||
location ^~ /app { | 19 | 19 | location ^~ /app { | |
alias /srv/flashy-frontend; | 20 | 20 | alias /srv/flashy-frontend; | |
} | 21 | 21 | } | |
22 | 22 | |||
location ~ /(api|admin|api-auth)/ { | 23 | 23 | location ~ /(api|admin|api-auth)/ { | |
proxy_pass http://backend_production; | 24 | 24 | proxy_pass http://backend_production; | |
proxy_redirect http://backend_production $scheme://flashy.cards; | 25 | 25 | proxy_redirect http://backend_production $scheme://flashy.cards; | |
proxy_set_header Host $host; | 26 | 26 | proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | 27 | 27 | proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 28 | 28 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | 29 | 29 | proxy_set_header X-Forwarded-Proto $scheme; | |
30 | proxy_set_header REMOTE_ADDR $remote_addr; | |||
} | 30 | 31 | } | |
31 | 32 | |||
location ^~ /jenkins { | 32 | 33 | location ^~ /jenkins { | |
proxy_pass http://localhost:8080; | 33 | 34 | proxy_pass http://localhost:8080; | |
proxy_redirect http://localhost:8080 $scheme://flashy.cards; | 34 | 35 | proxy_redirect http://localhost:8080 $scheme://flashy.cards; | |
proxy_set_header Host $host; | 35 | 36 | proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | 36 | 37 | proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 37 | 38 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | 38 | 39 | proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_read_timeout 90; | 39 | 40 | proxy_read_timeout 90; | |
} | 40 | 41 | } | |
ssl_certificate /etc/nginx/ssl/bundle.crt; | 41 | 42 | ssl_certificate /etc/nginx/ssl/bundle.crt; | |
ssl_certificate_key /etc/nginx/ssl/nginx.key; | 42 | 43 | ssl_certificate_key /etc/nginx/ssl/nginx.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | 43 | 44 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS; | 44 | 45 | ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS; | |
ssl_prefer_server_ciphers on; | 45 | 46 | ssl_prefer_server_ciphers on; | |
keepalive_timeout 70; | 46 | 47 | keepalive_timeout 70; | |
ssl_session_cache shared:SSL:10m; | 47 | 48 | ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | 48 | 49 | ssl_session_timeout 10m; | |
add_header Strict-Transport-Security "max-age=259200"; | 49 | 50 | add_header Strict-Transport-Security "max-age=259200"; | |
} | 50 | 51 | } |