Advertisement
fragilbert

Nginx Omeka

Nov 21st, 2023
1,475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.44 KB | None | 0 0
  1. server {
  2.         server_name omeka.domain.tld;
  3.         root /var/www/omeka;
  4.  
  5.         location = /favicon.ico {
  6.                 log_not_found off;
  7.                 access_log off;
  8.         }
  9.  
  10.         location = /robots.txt {
  11.                 allow all;
  12.                 log_not_found off;
  13.                 access_log off;
  14.         }
  15.  
  16.         location ~ \..*/.*\.php$ {
  17.                 return 403;
  18.         }
  19.  
  20.         location / {
  21.                 try_files $uri /index.php?$args;
  22.         }
  23.  
  24.         location /admin {
  25.                 try_files $uri /admin/index.php?$args;
  26.         }
  27.  
  28.         location ~ \.php$ {
  29.                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
  30.                 #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  31.                 include fastcgi_params;
  32.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  33.                 fastcgi_intercept_errors on;
  34.                 fastcgi_pass unix:/tmp/phpfpm.sock;
  35.         }
  36.  
  37.         location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  38.                 expires max;
  39.                 log_not_found off;
  40.         }
  41.  
  42.         location /install {
  43.                 try_files $uri /install/index.php?$args;
  44.  
  45.                 # This is an odd way to check that rewrites work...
  46.                 location ~* /install/check-mod-rewrite([^/]*)\.html$ {
  47.                         rewrite ^ /install/mod-rewrite.php?enabled=true;
  48.                 }
  49.         }
  50. }
Tags: nginx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement