Commit efebf246109796c8e30a9702d3d41040e9c0d4c0

Authored by Andrew Buss
1 parent 1c310a1619
Exists in master

Updated frontend to serve home.html for all URLs..

Showing 1 changed file with 1 additions and 1 deletions Inline Diff

nginxconf/flashy.cards View file @ efebf24
upstream backend_production { 1 1 upstream backend_production {
# server unix:/tmp/flashy.sock; 2 2 # server unix:/tmp/flashy.sock;
server localhost:7002; 3 3 server localhost:7002;
} 4 4 }
5 5
server { 6 6 server {
7 7
server_name flashy.cards; 8 8 server_name flashy.cards;
listen 443 ssl; 9 9 listen 443 ssl;
location / { 10 10 location / {
root /srv/flashy.cards/; 11 11 root /srv/flashy.cards/;
} 12 12 }
13 13
location ^~ /static { 14 14 location ^~ /static {
root /srv/; 15 15 root /srv/;
access_log off; 16 16 access_log off;
expires 30d; 17 17 expires 30d;
} 18 18 }
19 19
location ^~ /app { 20 20 location ^~ /app {
alias /srv/flashy-frontend; 21 21 alias /srv/flashy-frontend;
try_files $uri home.html; 22 22 try_files $uri /srv/flashy-frontend/home.html;
} 23 23 }
24 24
location ~ /(api|admin|api-auth)/ { 25 25 location ~ /(api|admin|api-auth)/ {
add_header 'Access-Control-Allow-Origin' 'http://localhost/'; 26 26 add_header 'Access-Control-Allow-Origin' 'http://localhost/';
add_header 'Access-Control-Allow-Credentials' 'true'; 27 27 add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PATCH, PUT'; 28 28 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PATCH, PUT';
proxy_pass http://backend_production; 29 29 proxy_pass http://backend_production;
proxy_redirect http://backend_production $scheme://flashy.cards; 30 30 proxy_redirect http://backend_production $scheme://flashy.cards;
proxy_set_header Host $host; 31 31 proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; 32 32 proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 33 33 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; 34 34 proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header REMOTE_ADDR $remote_addr; 35 35 proxy_set_header REMOTE_ADDR $remote_addr;
} 36 36 }
37 37
location ^~ /jenkins { 38 38 location ^~ /jenkins {
proxy_pass http://localhost:8080; 39 39 proxy_pass http://localhost:8080;
proxy_redirect http://localhost:8080 $scheme://flashy.cards; 40 40 proxy_redirect http://localhost:8080 $scheme://flashy.cards;
proxy_set_header Host $host; 41 41 proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; 42 42 proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 43 43 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; 44 44 proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 90; 45 45 proxy_read_timeout 90;
} 46 46 }
ssl_certificate /etc/nginx/ssl/bundle.crt; 47 47 ssl_certificate /etc/nginx/ssl/bundle.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key; 48 48 ssl_certificate_key /etc/nginx/ssl/nginx.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 49 49 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; 50 50 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; 51 51 ssl_prefer_server_ciphers on;
keepalive_timeout 70; 52 52 keepalive_timeout 70;
ssl_session_cache shared:SSL:10m; 53 53 ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m; 54 54 ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=259200"; 55 55 add_header Strict-Transport-Security "max-age=259200";
} 56 56 }