12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- # See: https://www.nginx.com/resources/wiki/start/topics/recipes/codeigniter/
- # https://medium.com/@shrikeh/setting-up-nginx-and-php-fpm-in-docker-with-unix-sockets-6fdfbdc19f91
- upstream _php {
- server unix:/socks/php.socket;
- }
- server {
- listen 80;
- more_set_headers "Server: kickass";
- server_tokens off;
- # server_name ;
- root /usr/share/nginx/html;
- index index.html index.php;
- # set expiration of assets
- location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
- expires 14d;
- log_not_found off;
- }
- # location / {
- # # check if a file or directory
- # try_files $uri $uri/ /index.php;
- # }
- # location ~ ^/(index|load|api|thumb|opensearch_desc)\.php$ {
- location ~* \.php$ {
- # fastcgi_pass php:9000;
- # include fastcgi.conf;
- fastcgi_pass _php;
- include fastcgi.conf;
- fastcgi_hide_header X-Powered-By;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- # or possibly include fastcgi_params; ?
- }
- location ~ ^/resources/(assets|lib|src) {
- try_files $uri 404;
- add_header Cache-Control "public";
- expires 1d;
- }
- location ~ ^/(skins|extensions).+.(css|js|gif|jpg|jpeg|png|svg)$ {
- try_files $uri 404;
- add_header Cache-Control "public";
- expires 1d;
- }
- # location = /favicon.ico {
- # alias /images/6/64/Favicon.ico;
- # # add_header Cache-Control "public";
- # # expires 1d;
- # }
- # location /wiki/ {
- # rewrite ^/wiki/(?<pagename>.*)$ /index.php;
- # }
- }
|