Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.94 KB | None | 0 0
  1. user nginx;
  2. worker_processes auto;
  3.  
  4. error_log /var/log/nginx/error.log;
  5.  
  6. events {
  7.     worker_connections 1024;
  8. }
  9.  
  10. http {
  11.     include mime.types;
  12.     default_type application/octect-stream;
  13.  
  14.     log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  15.                     '$status $body_bytes_sent "$http_referer" '
  16.                     '"$http_user_agent" "$http_x_forwarded_for"';
  17.  
  18.     server {
  19.         listen 80;
  20.         server_name localhost;
  21.         access_log   /var/log/nginx/access.log;
  22.         root /usr/share/nginx/;
  23.  
  24.         #location / {
  25.         #}
  26.  
  27.         # redirect 400 error pages to the static page /40x.html
  28.  
  29.         error_page 404 /404.html;
  30.             location = /html/404.html {
  31.         }
  32.  
  33.         # redirect server error pages to the static page /50x.html
  34.  
  35.         error_page 500 502 503 504 /50x.html;
  36.             location = /html/50x.html {
  37.         }
  38.  
  39.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  40.  
  41.         location ~ \.php$ {
  42.             try_files $uri = 404;
  43.             fastcgi_pass 127.0.0.1:9000;
  44.             fastcgi_index index.php;
  45.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  46.             include fastcgi_params;
  47.         }
  48.  
  49.         # deny access to .htaccess files, if Apache's document root
  50.  
  51.         location ~ /\.ht {
  52.             deny all;
  53.         }
  54.  
  55.         # location / {
  56.         #     try_files $uri $uri/ @rewrite;
  57.         # }
  58.  
  59.         location ~ /mediawiki28/ {
  60.             try_files $uri $uri/ @rewrite;
  61.         }
  62.  
  63.         location ~ /mediawiki23/ {
  64.             try_files $uri $uri/ @rewrite2;
  65.         }
  66.  
  67.         location ~ /mediawiki19/ {
  68.             try_files $uri $uri/ @rewrite3;
  69.         }
  70.  
  71.         #location ~ /m/ {
  72.         #    try_files $uri $uri/ @rewrite4;
  73.         #}
  74.  
  75.         location @rewrite {
  76.             rewrite ^/(.*)$ /mediawiki28/index.php?title=$1&$args;
  77.         }
  78.  
  79.         location @rewrite2 {
  80.             rewrite ^/(.*)$ /mediawiki23/index.php?title=$1&$args;
  81.         }
  82.  
  83.         location @rewrite3 {
  84.             rewrite ^/(.*)$ /mediawiki19/index.php?title=$1&$args;
  85.         }
  86.  
  87.         location @rewrite4 {
  88.             rewrite ^/(.*)$ /m/index.php?title=$1&$args;
  89.         }
  90.  
  91.         location ^~ /mediawiki(28)/maintenance/ {
  92.             return 403;
  93.         }
  94.  
  95.         location ~ \.php$ {
  96.             include fastcgi_params;
  97.             fastcgi_pass unix:/tmp/phpfpm.sock;
  98.         }
  99.  
  100.         location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  101.             try_files $uri /index.php;
  102.             expires max;
  103.             log_not_found off;
  104.         }
  105.  
  106.         location = /_.gif {
  107.             expires max;
  108.             empty_gif;
  109.         }
  110.  
  111.         location ^~ /mediawik(28)/cache/ {
  112.             deny all;
  113.         }
  114.  
  115.         location /mediawiki(28)/dumps {
  116.             root /usr/share/nginx/html/mediawiki28/local;
  117.             autoindex on;
  118.         }
  119.     }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement