Commit 64ad0b96d5d2348b06a58a220d7fbca5196f8fe5
1 parent
02c3927e2c
Exists in
master
Reformatted nginx conf and fixed php
Showing 1 changed file with 8 additions and 8 deletions Inline Diff
nginxconf/flashy.cards
View file @
64ad0b9
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 ~ \.php$ { | 10 | 10 | ||
11 | ||||
12 | location / { | |||
13 | root /srv/flashy.cards/; | |||
14 | index index.html /docs/_h5ai/server/php/index.php; | |||
15 | location ~ \.php$ { | |||
try_files $uri =404; | 11 | 16 | try_files $uri =404; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | 12 | 17 | fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | 13 | |||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | 14 | |||
include fastcgi_params; | 15 | 18 | include fastcgi_params; | |
19 | } | |||
} | 16 | 20 | } | |
17 | 21 | |||
location / { | 18 | |||
root /srv/flashy.cards/; | 19 | |||
} | 20 | |||
21 | ||||
location ^~ /static { | 22 | 22 | location ^~ /static { | |
root /srv/; | 23 | 23 | root /srv/; | |
access_log off; | 24 | 24 | access_log off; | |
expires 30d; | 25 | 25 | expires 30d; | |
} | 26 | 26 | } | |
27 | 27 | |||
location ^~ /app/ { | 28 | 28 | location ^~ /app/ { | |
alias /srv/flashy-frontend/; | 29 | 29 | alias /srv/flashy-frontend/; | |
try_files $uri /app/home.html; | 30 | 30 | try_files $uri /app/home.html; | |
} | 31 | 31 | } | |
32 | 32 | |||
location ~ /(api|admin|api-auth)/ { | 33 | 33 | location ~ /(api|admin|api-auth)/ { | |
add_header 'Access-Control-Allow-Origin' 'http://localhost'; | 34 | 34 | add_header 'Access-Control-Allow-Origin' 'http://localhost'; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | 35 | 35 | add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PATCH, PUT'; | 36 | 36 | 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,X-CSRFToken'; | 37 | 37 | 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; | 38 | 38 | proxy_pass http://backend_production; | |
proxy_redirect http://backend_production $scheme://flashy.cards; | 39 | 39 | proxy_redirect http://backend_production $scheme://flashy.cards; | |
proxy_set_header Host $host; | 40 | 40 | proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | 41 | 41 | proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 42 | 42 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | 43 | 43 | proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header REMOTE_ADDR $remote_addr; | 44 | 44 | proxy_set_header REMOTE_ADDR $remote_addr; | |
} | 45 | 45 | } | |
46 | 46 | |||
location ^~ /jenkins { | 47 | 47 | location ^~ /jenkins { | |
proxy_pass http://localhost:8080; | 48 | 48 | proxy_pass http://localhost:8080; | |
proxy_redirect http://localhost:8080 $scheme://flashy.cards; | 49 | 49 | proxy_redirect http://localhost:8080 $scheme://flashy.cards; | |
proxy_set_header Host $host; | 50 | 50 | proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | 51 | 51 | proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | 52 | 52 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | 53 | 53 | proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_read_timeout 90; | 54 | 54 | proxy_read_timeout 90; | |
} | 55 | 55 | } | |
ssl_certificate /etc/nginx/ssl/bundle.crt; | 56 | 56 | ssl_certificate /etc/nginx/ssl/bundle.crt; | |
ssl_certificate_key /etc/nginx/ssl/nginx.key; | 57 | 57 | ssl_certificate_key /etc/nginx/ssl/nginx.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | 58 | 58 | 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; | 59 | 59 | 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; | 60 | 60 | ssl_prefer_server_ciphers on; | |
keepalive_timeout 70; | 61 | 61 | keepalive_timeout 70; | |
ssl_session_cache shared:SSL:10m; | 62 | 62 | ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | 63 | 63 | ssl_session_timeout 10m; | |
add_header Strict-Transport-Security "max-age=259200"; | 64 | 64 | add_header Strict-Transport-Security "max-age=259200"; | |
} | 65 | 65 | } |