mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
64 lines
1.8 KiB
Nginx Configuration File
64 lines
1.8 KiB
Nginx Configuration File
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name hydro.ac;
|
|
root /root/.hydro/static;
|
|
access_log /data/access.log combined buffer=512k flush=1m;
|
|
error_log /data/error.log warn;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
|
|
|
|
# If you have brotli module installed
|
|
# brotli on;
|
|
# brotli_comp_level 6;
|
|
# brotli_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
|
|
|
|
# ssl_certificate /path/to/hydro.ac/fullchain.pem;
|
|
# ssl_certificate_key /path/to/hydro.ac/privkey.pem;
|
|
# ssl_trusted_certificate /path/to/hydro.ac/chain.pem;
|
|
|
|
# You may want to enable this if nginx reports '[emerg] unknown "connection_upgrade" variable'
|
|
# ref: https://blog.tsinbei.com/en/archives/677/
|
|
# map $http_upgrade $connection_upgrade {
|
|
# default upgrade;
|
|
# '' close;
|
|
# }
|
|
|
|
location / {
|
|
try_files $uri @proxy_to_app;
|
|
}
|
|
|
|
location @proxy_to_app {
|
|
proxy_pass http://localhost:8888;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name www.hydro.ac;
|
|
|
|
# ssl_certificate /path/to/www.hydro.ac/fullchain.pem;
|
|
# ssl_certificate_key /path/to/www.hydro.ac/privkey.pem;
|
|
# ssl_trusted_certificate /path/to/www.hydro.ac/chain.pem;
|
|
return 301 https://hydro.ac$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name .hydro.ac;
|
|
|
|
return 301 https://hydro.ac$request_uri;
|
|
}
|