-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from SELab-2/feature/nginx_routes
app.conf changes
- Loading branch information
Showing
2 changed files
with
60 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,68 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
http { | ||
map $request_method $index_req { | ||
POST "index_post"; | ||
default "default_index"; # A default value to prevent errors. | ||
} | ||
|
||
upstream express_server { | ||
server localhost:3000; | ||
} | ||
|
||
|
||
|
||
server { | ||
listen 80; | ||
listen [::]:80; | ||
|
||
server_name sel2-6.ugent.be www.sel2-6.ugent.be; | ||
server_tokens off; | ||
server_name sel2-6.ugent.be www.sel2-6.ugent.be; | ||
server_tokens off; | ||
|
||
location /.well-known/acme-challenge/ { | ||
location /.well-known/acme-challenge/ { | ||
root /var/www/certbot; | ||
} | ||
} | ||
|
||
location / { | ||
return 301 https://sel2-6.ugent.be$request_uri; | ||
} | ||
} | ||
location / { | ||
return 301 https://sel2-6.ugent.be$request_uri; | ||
} | ||
} | ||
|
||
server { | ||
listen 443 default_server ssl http2; | ||
listen [::]:443 ssl http2; | ||
server { | ||
listen 443 default_server ssl http2; | ||
listen [::]:443 ssl http2; | ||
|
||
server_name sel2-6.ugent.be; | ||
server_name sel2-6.ugent.be; | ||
|
||
ssl_certificate /etc/nginx/ssl/live/sel2-6.ugent.be/fullchain.pem; | ||
ssl_certificate_key /etc/nginx/ssl/live/sel2-6.ugent.be/privkey.pem; | ||
ssl_certificate /etc/nginx/ssl/live/sel2-6.ugent.be/fullchain.pem; | ||
ssl_certificate_key /etc/nginx/ssl/live/sel2-6.ugent.be/privkey.pem; | ||
|
||
location /api/ { | ||
proxy_pass http://spring_container:8080; | ||
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 Authorization $http_authorization; | ||
} | ||
location / { | ||
root /usr/share/nginx/html/build; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
location /api/ { | ||
proxy_pass http://spring_container:8080; | ||
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 Authorization $http_authorization; | ||
break; | ||
} | ||
|
||
location /web/ { | ||
proxy_pass http://express_server; | ||
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; | ||
break; | ||
} | ||
|
||
location / { | ||
|
||
if ($index_req = "index_post") { | ||
proxy_pass http://express_server; | ||
break; | ||
} | ||
|
||
root /usr/share/nginx/html/build; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} | ||
} |