Commit 6c7738d1c2c4d6749f5b699c032bb8092fda1492

Authored by Rohan Rangray
Exists in master

Merge branch 'master' of https://git.ucsd.edu/110swag/flashy-backend

Finished writing tests.

Showing 1 changed file Inline Diff

nginxconf/flashy.cards View file @ 6c7738d
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 /app/home.html; 22 22 try_files $uri /app/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';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,Origin,Authorization,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; 29 29 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,Origin,Authorization,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-CSRFToken';
proxy_pass http://backend_production; 30 30 proxy_pass http://backend_production;
proxy_redirect http://backend_production $scheme://flashy.cards; 31 31 proxy_redirect http://backend_production $scheme://flashy.cards;
proxy_set_header Host $host; 32 32 proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; 33 33 proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 34 34 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; 35 35 proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header REMOTE_ADDR $remote_addr; 36 36 proxy_set_header REMOTE_ADDR $remote_addr;
} 37 37 }
38 38
location ^~ /jenkins { 39 39 location ^~ /jenkins {
proxy_pass http://localhost:8080; 40 40 proxy_pass http://localhost:8080;
proxy_redirect http://localhost:8080 $scheme://flashy.cards; 41 41 proxy_redirect http://localhost:8080 $scheme://flashy.cards;
proxy_set_header Host $host; 42 42 proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; 43 43 proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 44 44 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; 45 45 proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 90; 46 46 proxy_read_timeout 90;
} 47 47 }
ssl_certificate /etc/nginx/ssl/bundle.crt; 48 48 ssl_certificate /etc/nginx/ssl/bundle.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key; 49 49 ssl_certificate_key /etc/nginx/ssl/nginx.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 50 50 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; 51 51 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; 52 52 ssl_prefer_server_ciphers on;
keepalive_timeout 70; 53 53 keepalive_timeout 70;
ssl_session_cache shared:SSL:10m; 54 54 ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m; 55 55 ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=259200"; 56 56 add_header Strict-Transport-Security "max-age=259200";
} 57 57 }