우리는 modx 사이트를 가지고 있으며 URL을 다시 쓰려고합니다. 하지만 매번 우리가 www.example.com/hello/x123처럼 다시 할 패턴 MODx URL nginx를 다시 작성
www.example.com/abc.html?arg1=x123 & ARG2 = 555L
처럼 가지고 실패 우리가우리의 nginx 서버를 사용하고 있는지 어떻게 할 수 -555L
server {
listen 80;
server_name www.example.com example.com;
root /var/www/test;
index index.php index.html;
location ~* .(jpg|jpeg|png|gif|ico|css|js|ttf)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~ .(aspx|jsp|cgi)$ {
return 410;
}
# exclude /favicon.ico from logs
location = /favicon.ico {
log_not_found off;
access_log off;
}
if ($host = "example.com") {
rewrite^$scheme://www.example.com$uri permanent;
}
location/{
root /var/www/test;
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
#www.example.com/abc.html?arg1=x123&arg2=555L => www.example.com/hello/x123-555L
location = /abc-xyz.html {
rewrite^/hello/$arg_arg1-$arg_arg2 last;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_ignore_client_abort on;
fastcgi_param SERVER_NAME $http_host;
}
location ~ /\.ht {
deny all;
}
}
, 명확하게 이해하지 못했다 브라우저에 표시 할이 두 개의 링크, 어떤 당신이 실제로 전달하려는 그 어떤 – SuddenHead
를 백엔드 두 번째 URL은 예상 URL입니다. –