101 lines
3.3 KiB
Plaintext
101 lines
3.3 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
server_name events.furmeet.app;
|
|
|
|
include /etc/nginx/snippets/acme.conf;
|
|
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
|
|
server_name events.furmeet.app;
|
|
|
|
client_max_body_size 10M;
|
|
|
|
root /var/www/furmeet-events/;
|
|
|
|
location ~* "^/api/conventions/([A-Za-z0-9_-]+)/minified.json$" {
|
|
alias /var/www/furmeet-events/static/json_cache/convention_$1.json;
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
gzip on;
|
|
proxy_intercept_errors on;
|
|
recursive_error_pages on;
|
|
error_page 404 @proxy;
|
|
}
|
|
|
|
location = / {
|
|
alias /var/www/furmeet-events/static/;
|
|
gzip on;
|
|
try_files index.html index.htm;
|
|
}
|
|
|
|
location ~* /diagram.png {
|
|
alias /var/www/furmeet-events/static/diagram.png;
|
|
gzip on;
|
|
}
|
|
|
|
location ~* /favicon.ico {
|
|
alias /var/www/furmeet-events/static/favicon.ico;
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
gzip on;
|
|
}
|
|
|
|
location /static {
|
|
alias /var/www/furmeet-events/static;
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
gzip on;
|
|
autoindex on;
|
|
}
|
|
|
|
location /media {
|
|
alias /var/www/furmeet-events/media;
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS';
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
gzip on;
|
|
autoindex on;
|
|
}
|
|
|
|
location @proxy {
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-NginX-Proxy true;
|
|
|
|
gzip on;
|
|
sub_filter_last_modified on;
|
|
|
|
proxy_pass http://127.0.0.1:61574;
|
|
proxy_redirect off;
|
|
|
|
# Socket.IO Support
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 30s;
|
|
proxy_send_timeout 30s;
|
|
}
|
|
|
|
location / {
|
|
try_files does_not_exist.txt @proxy;
|
|
}
|
|
|
|
include /etc/nginx/snippets/tlsgzip.conf;
|
|
|
|
} |