Advertisement
Guest User

nginx ipb ip. board rewrite url admin api remove index.php

a guest
Apr 8th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.73 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     listen [::]:80;
  4.     server_name forum.l2j.com;
  5.  
  6.     root /var/www/forum;
  7.     index index.php;
  8.  
  9.     location / {
  10.         try_files $uri $uri/ /index.php$is_args$args;
  11.     }
  12.  
  13.     location /admin/ {
  14.         try_files $uri $uri/ /admin/index.php$args;
  15.     }
  16.    
  17.     location /api/ {
  18.         rewrite ^/api/(.*)$ /api/index.php;
  19.     }
  20.  
  21.     location ~ \.php$ {
  22.         try_files $uri =404;
  23.         fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  24.         fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
  25.         include fastcgi_params;
  26.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  27.         fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  28.         fastcgi_index index.php;
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement