38 lines
1012 B
Plaintext
38 lines
1012 B
Plaintext
server {
|
|
root /var/www/example.com/html;
|
|
index index.html;
|
|
|
|
server_name example.com www.example.com;
|
|
|
|
location / {
|
|
try_files $uri /index.html
|
|
}
|
|
|
|
listen [::]:443 ssl ipv6only=on;
|
|
listen 443 ssl;
|
|
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/texample.com/privkey.pem;
|
|
|
|
location /server {
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Host $host;
|
|
proxy_pass http://localhost:8585;
|
|
}
|
|
}
|
|
|
|
server {
|
|
if ($host = www.example.com) {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
if ($host = example.com) {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
server_name example.com www.example.com;
|
|
return 404;
|
|
}
|