Привет, помогите задать правильную конфигурацию nginx для работы xenforo на localhost под windows
В общем скачал, установил winginix(nginx+php+mySql...),
залил форум C:\Winginx\home\forum.com\public_html
в общем форум начал отображаться, админка работает норм, главная страница форума отображается, но не можно переходить по темах и т.д., в общем такое было когда не было файла .htaccess на Apach'е? пишет
404 Not Found
Файл nginx.conf
В общем скачал, установил winginix(nginx+php+mySql...),
залил форум C:\Winginx\home\forum.com\public_html
в общем форум начал отображаться, админка работает норм, главная страница форума отображается, но не можно переходить по темах и т.д., в общем такое было когда не было файла .htaccess на Apach'е? пишет
404 Not Found
Файл nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid temp/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
client_max_body_size 55m;
#gzip on;
scgi_temp_path temp/uwsgi_temp 1 2;
uwsgi_temp_path temp/uwsgi_temp 1 2;
fastcgi_connect_timeout 1;
server {
listen 127.0.0.1:80;
root home/localhost/public_html;
index index.php index.html;
log_not_found off;
charset utf-8;
access_log logs/access.log main;
location ~ /\. {deny all;}
location / {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
}
location ~ \.php$ {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
if (!-e $document_root$document_uri){return 404;}
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 127.0.0.1:443;
include ssl.conf;
root home/localhost/public_html;
index index.php index.html;
log_not_found off;
charset utf-8;
access_log logs/access.log main;
location ~ /\. {deny all;}
location / {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
}
location ~ \.php$ {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
if (!-e $document_root$document_uri){return 404;}
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
///////////////////////////////////////////////// добавил только это что ниже, но не помогло//////////////////////////////////////
server {
listen 127.0.0.1:80;
root home/xenforum.com/public_html;
index index.php index.html;
# Some incorrect calls from browsers
rewrite ^/(.*)/data/avatars/(.*)$ /data/avatars/$2 last;
rewrite ^/(.*)/styles/(.*)/xenforo/(.*)$ /styles/$2/xenforo/$3 last;
rewrite ^/http:/(.*)/login/login$ /login/login last;
# Full Friendly URLs
location / {
try_files $uri $uri/ /index.php?$uri&$args;
index index.php index.html;
}
location ~ ^/(install|internal_data|library)/ {
internal;
}
location ~ /\.ht {
deny all;
}
# Static content
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp3|mp4|ogg|ogv|webm|htc|ttf|ttc|otf|eot|woff|font.css)$ {
expires 30d;
access_log off;
add_header Cache-Control public;
}
}
include tools-*.conf;
include vhosts/*.conf;
}
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid temp/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
client_max_body_size 55m;
#gzip on;
scgi_temp_path temp/uwsgi_temp 1 2;
uwsgi_temp_path temp/uwsgi_temp 1 2;
fastcgi_connect_timeout 1;
server {
listen 127.0.0.1:80;
root home/localhost/public_html;
index index.php index.html;
log_not_found off;
charset utf-8;
access_log logs/access.log main;
location ~ /\. {deny all;}
location / {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
}
location ~ \.php$ {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
if (!-e $document_root$document_uri){return 404;}
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 127.0.0.1:443;
include ssl.conf;
root home/localhost/public_html;
index index.php index.html;
log_not_found off;
charset utf-8;
access_log logs/access.log main;
location ~ /\. {deny all;}
location / {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
}
location ~ \.php$ {
if ($host ~ ^(www\.)?([a-z0-9\-\.]:-)$){
root home/$2/public_html;
access_log logs/$2-access.log main;
}
if (!-e $document_root$document_uri){return 404;}
fastcgi_pass localhost:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
///////////////////////////////////////////////// добавил только это что ниже, но не помогло//////////////////////////////////////
server {
listen 127.0.0.1:80;
root home/xenforum.com/public_html;
index index.php index.html;
# Some incorrect calls from browsers
rewrite ^/(.*)/data/avatars/(.*)$ /data/avatars/$2 last;
rewrite ^/(.*)/styles/(.*)/xenforo/(.*)$ /styles/$2/xenforo/$3 last;
rewrite ^/http:/(.*)/login/login$ /login/login last;
# Full Friendly URLs
location / {
try_files $uri $uri/ /index.php?$uri&$args;
index index.php index.html;
}
location ~ ^/(install|internal_data|library)/ {
internal;
}
location ~ /\.ht {
deny all;
}
# Static content
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp3|mp4|ogg|ogv|webm|htc|ttf|ttc|otf|eot|woff|font.css)$ {
expires 30d;
access_log off;
add_header Cache-Control public;
}
}
include tools-*.conf;
include vhosts/*.conf;
}
Последнее редактирование: