TW-Requests/nginx/nginx.conf

91 lines
2.2 KiB
Nginx Configuration File
Raw Permalink Normal View History

2024-07-15 07:15:51 +00:00
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name anakinnikita.ru;
location /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name anakinnikita.ru;
root /var/www/html;
ssl_certificate /etc/letsencrypt/live/certfolder/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/certfolder/privkey.pem;
location / {
proxy_set_header Host $http_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;
proxy_pass http://fastapi_app:8000;
}
location /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
location /robots.txt {
root /var/www/html;
}
}
server {
listen 80;
server_name denis.anakinnikita.ru;
location /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name denis.anakinnikita.ru;
root /var/www/html;
ssl_certificate /etc/letsencrypt/live/denis/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/denis/privkey.pem;
location / {
proxy_set_header Host $http_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;
proxy_pass http://xls:8080;
}
location /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
location /robots.txt {
root /var/www/html;
}
}
}