Ruby on rails nginx位置指令
我有一个带有rails应用程序的nginx服务器。 我的nginx.conf是Ruby on rails nginx位置指令,ruby-on-rails,nginx,location,passenger,Ruby On Rails,Nginx,Location,Passenger,我有一个带有rails应用程序的nginx服务器。 我的nginx.conf是 server { listen 80; server_name nerto.it; root /var/www/current/public; passenger_enabled on; location /m { passenger_enabled off; index index.html index.php;
server {
listen 80;
server_name nerto.it;
root /var/www/current/public;
passenger_enabled on;
location /m {
passenger_enabled off;
index index.html index.php;
try_files $uri $uri/ /m/index.html?q=$uri;
}
...
}
除了像这样的地址,它还能工作
nerto.it/mprove或nerto.it/mtry
其中,首字母为/m,nginx采用类似nerto.it/m的地址
我该怎么解决呢?我想你应该试试这样的smth:
location ~* ^/m(.*) {
正则表达式是通过在它们前面加上“~*”前缀(不区分大小写的匹配)或“~”前缀(区分大小写的匹配)来指定的
或
你的问题不清楚你期望什么样的行为
请阅读文档:
location /m/ {
passenger_enabled off;
index index.html index.php;
try_files $uri $uri/ /m/index.html?q=$uri;
}
location = /m {
...
}