Mercurial > Pritunl-Fake-API
diff docker/api-only/conf.d/pritunl-fake-api.conf @ 0:b51518614818 default tip
New Files
author | Pluto <meokcin@gmail.com> |
---|---|
date | Tue, 03 Sep 2024 15:57:25 +0800 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docker/api-only/conf.d/pritunl-fake-api.conf Tue Sep 03 15:57:25 2024 +0800 @@ -0,0 +1,40 @@ + # Pritunl Fake API Server definition + server { + listen [::]:80 default_server; + listen 80 default_server; + server_name _; + + sendfile off; + tcp_nodelay on; + absolute_redirect off; + + root /var/www/html; + index index.php index.html; + + location / { + # First attempt to serve request as file, then + # as directory, then fall back to index.php + try_files $uri $uri/ /index.php?path=$uri&$args; + } + + # Pass the PHP scripts to PHP-FPM listening on php-fpm.sock + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/run/php-fpm.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_index index.php; + include fastcgi_params; + } + + location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ { + expires 5d; + } + + # Deny access to . files, for security + location ~ /\. { + log_not_found off; + deny all; + } + } \ No newline at end of file