我是从 apache 开始接触 nginx 的新手,我正在尝试执行遵循这种简单格式的重定向。
http://sub.domain.tld/location=BLAH
应该重定向到
http://sub.domain.tld/location/directory1/directory2/BLAH/index.html
sub.domain.tld 启用了 http 和 https--不确定是否有区别。
当前服务器配置:
server {
server_name sub.domain.tld;
listen 1.2.3.4:80;
listen [dead:beef:feed:deed::]:80;
root /path/to/web/root/;
if ($request_method !~ ^(GET|HEAD|POST)$ ) { return 444; }
location / {
index will.never.exist.xyz;
try_files $uri $uri/ =404;
autoindex on;
autoindex_exact_size off;
autoindex_format html;
autoindex_localtime off;
}
listen [dead:beef:feed:deed::]:443 ssl;
listen 1.2.3.4:443 ssl;
ssl_certificate /path/.../fullchain.pem;
ssl_certificate_key /path/.../privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}