-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
executable file
·40 lines (31 loc) · 1.09 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
upstream backend {
server unix:/var/www/gunicorn.sock fail_timeout=0;
}
server {
server_name new.sfucsss.org;
listen 80;
root /var/www/html;
access_log /var/www/logs/csss-site-backend/nginx-access.log;
error_log /var/www/logs/csss-site-backend/nginx-error.log;
# proxy csss-site-backend
location /api/ {
rewrite ^/api/(.*)$ /$1 break;
keepalive_timeout 5;
client_max_body_size 1G; # Was 4G
proxy_set_header Host $host;
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_pass http://backend;
add_header Access-Control-Allow-Origin https://new.sfucsss.org always;
add_header Access-Control-Allow-Credentials true;
}
# redirects old 2024 mountain madness requests to the new URL
location ~ ^/events/2024/mm(/|/index.html)?$ {
return 301 /mountain_madness/2024/index.html;
}
# any other matching path
location / {
try_files $uri $uri/ $uri/index.html =404;
}
}