Welcome! Log In Create A New Profile

Advanced

Re: nginx rewrite url

September 02, 2012 04:48PM
На все запросы - открывается исходный код php файла.
Конфигурационный файл nginx для сайта такой:
upstream backend-sitename.ru {server unix:/var/run/php5-sitename.ru.sock;}
server {
listen 80;
server_name sitename.ru;
rewrite ^ $scheme://www.sitename.ru$request_uri permanent;
}
server {
listen 80;
server_name www.sitename.ru;
root /var/www/ext/sitename.ru/data;
index index.php;
rewrite_log on;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass backend-sitename.ru;
}
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|bmp)$ {
access_log off;
expires 10d;
break;
}
location ~ /\.ht {
deny all;
}
}
Правило для редиректа вставляю после закрывающей скобки для server. Я правильно делаю или надо по другому?
Subject Author Posted

nginx rewrite url

senty September 01, 2012 06:12PM

Re: nginx rewrite url

San September 01, 2012 06:38PM

Re: nginx rewrite url

VBart September 01, 2012 08:10PM

Re: nginx rewrite url

senty September 02, 2012 01:44PM

Re: nginx rewrite url

VBart September 02, 2012 01:56PM

Re: nginx rewrite url

senty September 02, 2012 04:48PM

Re: nginx rewrite url

senty September 03, 2012 05:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 87
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready