sbin/docker/nginx.php-fpm.conf
author ymh <ymh.work@gmail.com>
Mon, 20 Nov 2023 18:10:58 +0100
changeset 1557 7c67caaafdeb
parent 1513 b833d7c72ea9
permissions -rw-r--r--
enmi 22

events {}

http {
    include mime.types;

    default_type application/octet-stream;

    # Update charset_types to match updated mime.types.
    # text/html is always included by charset module.
    charset_types
        text/css
        text/plain
        text/vnd.wap.wml
        application/javascript
        application/json
        application/rss+xml
        application/xml;

    charset utf-8;

    server {
        listen 8080;
        listen [::]:8080;
    
        server_name polemictweet.test;
    
        # error_log /var/log/nginx/polemictweet.test.error.log;
        # access_log /var/log/nginx/polemictweet.test.access.log;
    
        root /var/www/html;
        index index.php;

        # location / {
        #     root /var/www;
        #     index index.php index.html index.htm;
        #     try_files $uri $uri/ /index.php?q=$uri&$args;
        # }

        location ~ [^/]\.php(/|$) {
            if (!-e $request_filename){
                rewrite (.+)/([\w-]+)\.php$ /$2.php?rep=$1 last;
            }
            try_files $uri =404;
    
            fastcgi_pass php-fpm:9000;
            fastcgi_index index.php;
    #        fastcgi_intercept_errors on;
            fastcgi_split_path_info ^(.+?\.php)(/.*)$;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            fastcgi_param SCRIPT_NAME $fastcgi_script_name;
            include fastcgi_params;
        }
    
    }
}