我正在尝试将Ubuntu 18.04 VPS配置为同时作为nginx Web服务器和私有gitea服务器运行。我的配置工作正常,除了我域中的任何404传递到gitea并显示gitea404。我希望主域的任何用户都不要定向到Gitea。
目标:
尝试:
启用域站点的配置:
server {
root /var/www/example.com/html;
index index.html index.htm index.nginx-debian.html;
server_name git.example.com;
location / {
proxy_pass https://0.0.0.0:3000;
}
server_name *.example.com;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
#location / {
# try_files $uri $uri/ =404;
#}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate <path>/fullchain.pem; # managed by Certbot
ssl_certificate_key <path>/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
任何帮助将不胜感激。谢谢。