Skip to content

Commit f30dab8

Browse files
authored
Add to template wordpress2 rewrite for worpress
Without my changes i can use only http://example.com/?id=1 like on this site: http://napartments.pl/?page_id=162 after changes i can use http://example.com/post_name like on my site: https://s-m-s.pl/kontakt/. I want add new template because i thin rewrite is additional setting.
1 parent a07eb1d commit f30dab8

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
server {
2+
listen %ip%:%web_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
location = /favicon.ico {
10+
log_not_found off;
11+
access_log off;
12+
}
13+
14+
location = /robots.txt {
15+
allow all;
16+
log_not_found off;
17+
access_log off;
18+
}
19+
20+
location / {
21+
try_files $uri $uri/ /index.php?$args;
22+
23+
if (!-e $request_filename)
24+
{
25+
rewrite ^(.+)$ /index.php?q=$1 last;
26+
}
27+
28+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
29+
expires max;
30+
}
31+
32+
location ~ [^/]\.php(/|$) {
33+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
34+
if (!-f $document_root$fastcgi_script_name) {
35+
return 404;
36+
}
37+
38+
fastcgi_pass %backend_lsnr%;
39+
fastcgi_index index.php;
40+
include /etc/nginx/fastcgi_params;
41+
}
42+
}
43+
44+
error_page 403 /error/404.html;
45+
error_page 404 /error/404.html;
46+
error_page 500 502 503 504 /error/50x.html;
47+
48+
location /error/ {
49+
alias %home%/%user%/web/%domain%/document_errors/;
50+
}
51+
52+
location ~* "/\.(htaccess|htpasswd)$" {
53+
deny all;
54+
return 404;
55+
}
56+
57+
location /vstats/ {
58+
alias %home%/%user%/web/%domain%/stats/;
59+
include %home%/%user%/web/%domain%/stats/auth.conf*;
60+
}
61+
62+
include /etc/nginx/conf.d/phpmyadmin.inc*;
63+
include /etc/nginx/conf.d/phppgadmin.inc*;
64+
include /etc/nginx/conf.d/webmail.inc*;
65+
66+
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
67+
}

0 commit comments

Comments
 (0)