server {
listen 80;
listen [::]:80;
server_name git.mydomain.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8091;
}
}
server {
listen [::]:443 ssl ipv6only=on;
server_name git.mydomain.com;
ssl_certificate /etc/letsencrypt/live/git.mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/git.mydomain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8091;
}
}
server {
listen 80;
listen [::]:80;
server_name disk.mydomain.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8089;
}
}
server {
listen [::]:443 ssl ipv6only=on;
server_name disk.mydomain.com;
ssl_certificate /etc/letsencrypt/live/disk.mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/disk.mydomain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8089;
}
}
nginx: [emerg] duplicate listen options for [::]:443 in /etc/nginx/sites-enabled/git.mydomain.com.conf:14
nginx: configuration file /etc/nginx/nginx.conf test failed
Очень долго будет пытаться объяснить или приводить примеры, я создал проект для демонстрации https://disk.yandex.ru/d/Rbu0JlZl_pb8Nw
Из консольного приложения надо запустить webapp