Commit 10be3ef549e3712ac4625dad440967e6ad955d17
1 parent
08f8e748f3
Exists in
master
Added CORS origin for localhost
Showing 1 changed file with 2 additions and 0 deletions Inline Diff
nginxconf/flashy.cards
View file @
10be3ef
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 { | |
7 | ||||
server_name flashy.cards; | 7 | 8 | server_name flashy.cards; | |
listen 443 ssl; | 8 | 9 | listen 443 ssl; | |
location / { | 9 | 10 | location / { | |
root /srv/flashy.cards/; | 10 | 11 | root /srv/flashy.cards/; | |
} | 11 | 12 | } | |
12 | 13 | |||
location ^~ /static { | 13 | 14 | location ^~ /static { | |
root /srv/; | 14 | 15 | root /srv/; | |
access_log off; | 15 | 16 | access_log off; | |
expires 30d; | 16 | 17 | expires 30d; | |
} | 17 | 18 | } | |
18 | 19 | |||
location ^~ /app { | 19 | 20 | location ^~ /app { | |
alias /srv/flashy-frontend; | 20 | 21 | alias /srv/flashy-frontend; | |
} | 21 | 22 | } | |
22 | 23 | |||
location ~ /(api|admin|api-auth)/ { | 23 | 24 | location ~ /(api|admin|api-auth)/ { | |
25 | add_header 'Access-Control-Allow-Origin' 'http://localhost/'; | |||
proxy_pass http://backend_production; | 24 | 26 | proxy_pass http://backend_production; | |
proxy_redirect http://backend_production $scheme://flashy.cards; | 25 | 27 | proxy_redirect http://backend_production $scheme://flashy.cards; | |
proxy_set_header Host $host; | 26 | 28 | proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | 27 | 29 | proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 28 | 30 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | 29 | 31 | proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header REMOTE_ADDR $remote_addr; | 30 | 32 | proxy_set_header REMOTE_ADDR $remote_addr; | |
} | 31 | 33 | } | |
32 | 34 | |||
location ^~ /jenkins { | 33 | 35 | location ^~ /jenkins { | |
proxy_pass http://localhost:8080; | 34 | 36 | proxy_pass http://localhost:8080; | |
proxy_redirect http://localhost:8080 $scheme://flashy.cards; | 35 | 37 | proxy_redirect http://localhost:8080 $scheme://flashy.cards; | |
proxy_set_header Host $host; | 36 | 38 | proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | 37 | 39 | proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 38 | 40 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | 39 | 41 | proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_read_timeout 90; | 40 | 42 | proxy_read_timeout 90; | |
} | 41 | 43 | } | |
ssl_certificate /etc/nginx/ssl/bundle.crt; | 42 | 44 | ssl_certificate /etc/nginx/ssl/bundle.crt; | |
ssl_certificate_key /etc/nginx/ssl/nginx.key; | 43 | 45 | ssl_certificate_key /etc/nginx/ssl/nginx.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | 44 | 46 | 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; | 45 | 47 | 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; | 46 | 48 | ssl_prefer_server_ciphers on; | |
keepalive_timeout 70; | 47 | 49 | keepalive_timeout 70; | |
ssl_session_cache shared:SSL:10m; | 48 | 50 | ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | 49 | 51 | ssl_session_timeout 10m; | |
add_header Strict-Transport-Security "max-age=259200"; | 50 | 52 | add_header Strict-Transport-Security "max-age=259200"; | |
} | 51 | 53 | } |