在域文件“db.myplace.mydomain.com”中,我为反向代理配置了一个名称(proxy.myplace.mydomain.com)和一个 Web 应用程序的名称(myapp.myplace.mydomain.com)。但是,当我在浏览器中键入代理的名称时,myapp 的名称会返回给我。我不希望代理名称在浏览器中返回任何内容。我该如何配置?
db.myplace.mydomain.com 文件中的设置:
proxy IN A 192.168.0.20
myapp IN CNAME proxy
sites-available/myapp.conf 文件中的设置:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name myapp.myplace.mydomain.com;
# SSL
ssl_certificate /etc/nginx/ssl/certificate.crt;
ssl_certificate_key /etc/nginx/ssl/certificate.key;
# security
include nginxconfig.io/security.conf;
# reverse proxy
location / {
proxy_pass http://192.168.1.250:8080;
include nginxconfig.io/proxy.conf;
}
# additional config
include nginxconfig.io/general.conf;
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name myapp.myplace.mydomain.com;
return 301 https://myapp.myplace.mydomain.com$request_uri;
}