httpsImplement #4
|
|
@ -5,12 +5,22 @@
|
||||||
# }
|
# }
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
return 301 https://$host$request_uri; # Redirect HTTP sang HTTPS
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
server{
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name comp.soict.io;
|
||||||
|
ssl_certificate /etc/nginx/ssl/nginx-selfsigned.crt;
|
||||||
|
ssl_certificate_key /etc/nginx/ssl/nginx-selfsigned.key;
|
||||||
|
|
||||||
set $backend_server 172.18.10.8:8080;
|
set $backend_server 172.18.10.8:8080;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
# Default file to serve for directory requests
|
# Default file to serve for directory requests
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# Try to serve the requested file directly ($uri)
|
# Try to serve the requested file directly ($uri)
|
||||||
# If it's a directory, try serving the index file ($uri/)
|
# If it's a directory, try serving the index file ($uri/)
|
||||||
|
|
@ -68,4 +78,4 @@ server {
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user