56 lines
1.6 KiB
Plaintext
56 lines
1.6 KiB
Plaintext
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name graff.estate;
|
|
root /var/www/graff.estate/client/dist;
|
|
|
|
# SSL
|
|
ssl_certificate /etc/letsencrypt/live/graff.estate/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/graff.estate/privkey.pem;
|
|
ssl_trusted_certificate /etc/letsencrypt/live/graff.estate/chain.pem;
|
|
|
|
# security
|
|
include nginxconfig.io/security.conf;
|
|
|
|
# logging
|
|
access_log /var/log/nginx/access.log combined buffer=512k flush=1m;
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
# index.html fallback
|
|
location / {
|
|
# Убираем trailing slash и редиректим
|
|
rewrite ^/(.*)/$ /$1 permanent;
|
|
|
|
# Пробуем найти файл, затем с .html, затем 404
|
|
try_files $uri $uri.html /404.html;
|
|
}
|
|
|
|
# Явная обработка 404
|
|
# error_page 404 /404.html;
|
|
# location = /404.html {
|
|
# internal;
|
|
# }
|
|
|
|
|
|
location /api {
|
|
rewrite ^/api/(.*)$ /$1 break;
|
|
proxy_pass http://127.0.0.1:3003;
|
|
proxy_set_header Host $host;
|
|
include nginxconfig.io/proxy.conf;
|
|
}
|
|
|
|
# additional config
|
|
include nginxconfig.io/general.conf;
|
|
}
|
|
|
|
# HTTP redirect
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name graff.estate;
|
|
include nginxconfig.io/letsencrypt.conf;
|
|
|
|
location / {
|
|
return 301 https://graff.estate$request_uri;
|
|
}
|
|
} |