40 lines
1.1 KiB
Nginx Configuration File
40 lines
1.1 KiB
Nginx Configuration File
events {}
|
|
|
|
http {
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
'"$http_user_agent" "$http_x_forwarded_for" "$host"';
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
error_log /var/log/nginx/error.log;
|
|
|
|
|
|
server {
|
|
listen 80;
|
|
server_name your.domain.example;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/html;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name your.domain.example;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/your.domain.example/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/your.domain.example/privkey.pem;
|
|
|
|
location / {
|
|
proxy_pass http://<app_ip:app_port>;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|
|
} |