Answer the question
In order to leave comments, you need to log in
nginx setup?
Hello. I wrote a config for Apache for the site, but I use nginx (I can’t do it for it).
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/([a-z_A-Z_0-9\-]+).html$ /content.php?id=$1&key_en=$2 [L]
RewriteRule ^sitemap.xml$ /sitemap.php [L]
RewriteRule ^robots.txt$ /script/robots.php [L]
server {
server_name site.ru www.site.ru;
charset off;
disable_symlinks if_not_owner from=$root_path;
index index.php;
root $root_path;
set $root_path /var/www/gamepost/data/www/site.ru;
access_log /var/www/httpd-logs/site.ru.access.log ;
error_log /var/www/httpd-logs/site.ru.error.log notice;
listen IP:80;
include /etc/nginx/vhosts-includes/*.conf;
location / {
if (!-e $request_filename){ rewrite ^/([0-9]+)/([a-z_A-Z_0-9\-]+).html$ /content.php?id=$1&key_en=$2 break; }
}
location = /sitemap.xml {
rewrite ^(.*)$ /sitemap.php break;
}
location = /robots.txt {
rewrite ^(.*)$ /script/robots.php break;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]";
fastcgi_pass unix:/var/www/php-fpm/ggh.sock;
try_files $uri =404;
include fastcgi_params;
}
ssi on;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question