-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
44 lines (38 loc) · 1.52 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
41
42
43
44
# Redirect HTTP to HTTPS
server {
listen 80;
server_name campusconnects.de admin.campusconnects.de;
return 301 https://$host$request_uri;
}
# Backend service configuration on the main domain
server {
listen 443 ssl;
server_name campusconnects.de;
ssl_certificate /etc/letsencrypt/live/campusconnects.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/campusconnects.de/privkey.pem;
location / {
proxy_pass http://app:3000;
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_set_header Origin $http_origin; # Add this line to forward the Origin header
proxy_set_header Access-Control-Allow-Origin *;
proxy_set_header Access-Control-Allow-Methods 'GET,HEAD,PUT,PATCH,POST,DELETE';
proxy_set_header Access-Control-Allow-Credentials true;
}
}
# Flutter admin panel configuration on the subdomain
server {
listen 443 ssl;
server_name admin.campusconnects.de;
ssl_certificate /etc/letsencrypt/live/admin.campusconnects.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/admin.campusconnects.de/privkey.pem;
location / {
proxy_pass http://flutter-web-app;
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;
}
}