【发布时间】:2020-12-30 07:31:10
【问题描述】:
我有这个 nginx 配置..我希望它接受所有包含单词竞争并以 .com.au 结尾的域。我已经测试了一个不应接受但它到达应用程序的域名.. server_name 是否因为我使用代理而被忽略?
server {
listen 80 default_server;
server_name ~^(.+)competitions?(.+)\.com\.au;
access_log /var/log/nginx/$host.access.log;
error_log /var/log/nginx/error.log;
if ($host !~* ^www){
rewrite ^/(.*)$ https://www.$host/$1 permanent;
}
location / {
proxy_no_cache 1;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8888;
try_files $uri $uri/ @proxy;
}
location @proxy {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8888;
proxy_intercept_errors on;
recursive_error_pages on;
error_page 404 = @rewrite_proxy;
}
location @rewrite_proxy {
rewrite /(.*) /index.cfm?path=$1;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8888;
}
}
【问题讨论】:
标签: nginx-config