Advertisement
Dalexhd

NGINX config.

Jun 5th, 2019
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.93 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     server_name proyecto.test *.proyecto.test; #Dirección de la página
  4.     root "C:/laragon/www/clases-web/Proyectos/Pagina personal/public/"; #La dirección root del proyecto
  5.  
  6.     location ~ ^/admin/(.*)$ {
  7.         index admin.php;
  8.         try_files $uri $uri/ /admin.php?page=$1&$is_args$args; # try_files will need to be relative to root
  9.     }
  10.  
  11.     location / {
  12.         index public.php;
  13.         try_files $uri $uri/ /public.php$is_args$args;
  14.         autoindex on;
  15.     }
  16.    
  17.     location ~ \.php$ {
  18.         include snippets/fastcgi-php.conf;
  19.         fastcgi_pass php_upstream;     
  20.         #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  21.     }
  22.    
  23.     rewrite ^/api/([^/]+)/?$ /?api&method=$1 last;
  24.  
  25.    
  26.     charset utf-8;
  27.    
  28.     location = /favicon.ico { access_log off; log_not_found off; }
  29.     location = /robots.txt  { access_log off; log_not_found off; }
  30.     location ~ /\.ht {
  31.         deny all;
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement