84669인 학습
152542인 학습
20005인 학습
5487인 학습
7821인 학습
359900인 학습
3350인 학습
180660인 학습
48569인 학습
18603인 학습
40936인 학습
1549인 학습
1183인 학습
32909인 학습
위의 프록시 규칙은 적용되지 않습니다. 다시 쓰기 규칙을 삭제하면 충돌이 발생합니까? 어떻게 수정하나요?
ringa_lee
rewrite는 우선순위가 높으므로 경로가 먼저 다시 작성됩니다. 대신 location을 사용하여 일치시킬 수 있습니다. rewrite 优先级较高,导致路径已经先被重写了。可以都改用location去匹配。
rewrite
location
location ~ /(test1|test2|test3|test4) { proxy_set_header Host "test.com"; proxy_set_header X-Forwarded-For $remote_addr; proxy_pass http://127.0.0.1:8080; } location ~* ^/(.*)\.(zip|js|ico|css|xml|txt|html|swf|apk|ipa|plist)$ { rewrite ^/(.*)$ /index.php last; } location ~ \index.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_hide_header X-Powered-By; }
不过确定 静态文件也要重写到 index.php 으아아아
index.php
rewrite
는 우선순위가 높으므로 경로가 먼저 다시 작성됩니다. 대신location
을 사용하여 일치시킬 수 있습니다.rewrite
优先级较高,导致路径已经先被重写了。可以都改用location
去匹配。不过确定 静态文件也要重写到
하지만 정적 파일도index.php
으아아아index.php
로 다시 작성해야 합니까? 🎜