105 lines
2.8 KiB
Plaintext
105 lines
2.8 KiB
Plaintext
|
|
#user nobody;
|
|
worker_processes 1;
|
|
|
|
#error_log logs/error.log;
|
|
#error_log logs/error.log notice;
|
|
#error_log logs/error.log info;
|
|
|
|
#pid logs/nginx.pid;
|
|
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
# '$status $body_bytes_sent "$http_referer" '
|
|
# '"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
#access_log logs/access.log main;
|
|
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
|
|
#keepalive_timeout 0;
|
|
keepalive_timeout 65;
|
|
|
|
#gzip on;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name hsmod.xyz www.hsmod.xyz; # Change to your actual domain
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
# another virtual host using mix of IP-, name-, and port-based configuration
|
|
#
|
|
#server {
|
|
# listen 8000;
|
|
# listen somename:8080;
|
|
# server_name somename alias another.alias;
|
|
|
|
# location / {
|
|
# root html;
|
|
# index index.html index.htm;
|
|
# }
|
|
#}
|
|
|
|
|
|
# HTTPS server
|
|
#
|
|
server {
|
|
listen 443 ssl;
|
|
server_name hsmod.xyx www.hsmod.xyz; # Change to your actual domain
|
|
|
|
ssl_certificate /app/letsencrypt/fullchain.pem; # Path to fullchain.pem
|
|
ssl_certificate_key /app/letsencrypt/privkey.pem; # Path to privkey.pem
|
|
|
|
ssl_session_cache shared:SSL:1m;
|
|
ssl_session_timeout 5m;
|
|
|
|
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384';
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_dhparam /app/letsencrypt/ssl-dhparams.pem;
|
|
|
|
# FastCGI settings retained from your original config
|
|
location / {
|
|
fastcgi_param REQUEST_METHOD $request_method;
|
|
fastcgi_param QUERY_STRING $query_string;
|
|
fastcgi_param CONTENT_TYPE $content_type;
|
|
fastcgi_param CONTENT_LENGTH $content_length;
|
|
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
|
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
|
fastcgi_param REMOTE_ADDR $remote_addr;
|
|
fastcgi_param REMOTE_PORT $remote_port;
|
|
fastcgi_param SERVER_ADDR $server_addr;
|
|
fastcgi_param SERVER_PORT $server_port;
|
|
fastcgi_param SERVER_NAME $server_name;
|
|
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
|
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
fastcgi_param PATH_INFO $fastcgi_script_name;
|
|
fastcgi_pass 127.0.0.1:9002;
|
|
}
|
|
|
|
# Setup for serving static files
|
|
location /static/ {
|
|
root /app/hm_nginx/../hm_web/;
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
# Error pages configuration
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
}
|
|
} |