Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user nginx;
- worker_processes auto;
- error_log /var/log/nginx/error.log;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octect-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- server {
- listen 80;
- server_name localhost;
- access_log /var/log/nginx/access.log;
- root /usr/share/nginx/;
- #location / {
- #}
- # redirect 400 error pages to the static page /40x.html
- error_page 404 /404.html;
- location = /html/404.html {
- }
- # redirect server error pages to the static page /50x.html
- error_page 500 502 503 504 /50x.html;
- location = /html/50x.html {
- }
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- location ~ \.php$ {
- try_files $uri = 404;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- location ~ /\.ht {
- deny all;
- }
- # location / {
- # try_files $uri $uri/ @rewrite;
- # }
- location ~ /mediawiki28/ {
- try_files $uri $uri/ @rewrite;
- }
- location ~ /mediawiki23/ {
- try_files $uri $uri/ @rewrite2;
- }
- location ~ /mediawiki19/ {
- try_files $uri $uri/ @rewrite3;
- }
- #location ~ /m/ {
- # try_files $uri $uri/ @rewrite4;
- #}
- location @rewrite {
- rewrite ^/(.*)$ /mediawiki28/index.php?title=$1&$args;
- }
- location @rewrite2 {
- rewrite ^/(.*)$ /mediawiki23/index.php?title=$1&$args;
- }
- location @rewrite3 {
- rewrite ^/(.*)$ /mediawiki19/index.php?title=$1&$args;
- }
- location @rewrite4 {
- rewrite ^/(.*)$ /m/index.php?title=$1&$args;
- }
- location ^~ /mediawiki(28)/maintenance/ {
- return 403;
- }
- location ~ \.php$ {
- include fastcgi_params;
- fastcgi_pass unix:/tmp/phpfpm.sock;
- }
- location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
- try_files $uri /index.php;
- expires max;
- log_not_found off;
- }
- location = /_.gif {
- expires max;
- empty_gif;
- }
- location ^~ /mediawik(28)/cache/ {
- deny all;
- }
- location /mediawiki(28)/dumps {
- root /usr/share/nginx/html/mediawiki28/local;
- autoindex on;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement