generated from coop-cloud/example
76 lines
1.6 KiB
Plaintext
76 lines
1.6 KiB
Plaintext
# Default Server
|
|
server {
|
|
# Port that the web server will listen on.
|
|
listen 80 default;
|
|
|
|
# Host that will serve this project.
|
|
server_name _;
|
|
|
|
# The location of our projects public directory.
|
|
root /var/www/src/public;
|
|
|
|
# Index
|
|
index index.php index.html;
|
|
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
|
|
set $path_info2 "";
|
|
|
|
location ~ /include {
|
|
deny all;
|
|
return 403;
|
|
}
|
|
|
|
if ($request_uri ~ "^/api(/[^\?]+)") {
|
|
set $path_info2 $1;
|
|
}
|
|
|
|
location ~ ^/api/(?:tickets|tasks).*$ {
|
|
try_files $uri $uri/ /api/http.php?$query_string;
|
|
}
|
|
|
|
if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
|
|
set $path_info2 $1;
|
|
}
|
|
|
|
if ($request_uri ~ "^/.*\.php(/[^\?]+)") {
|
|
set $path_info2 $1;
|
|
}
|
|
|
|
location ~ ^/scp/ajax.php/.*$ {
|
|
try_files $uri $uri/ /scp/ajax.php?$query_string;
|
|
}
|
|
|
|
location ~ ^/ajax.php/.*$ {
|
|
try_files $uri $uri/ /ajax.php?$query_string;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ index.php;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
include snippets/fastcgi-php.conf;
|
|
fastcgi_param PATH_INFO $path_info2;
|
|
fastcgi_param HTTPS $fe_https;
|
|
fastcgi_pass unix:/run/php/php-fpm.sock;
|
|
}
|
|
|
|
location ~ /\.ht {deny all;}
|
|
}
|
|
|
|
# Status server
|
|
server {
|
|
listen 8080;
|
|
|
|
location /nginx_status {
|
|
stub_status on;
|
|
access_log off;
|
|
}
|
|
|
|
location ~ ^/(status|ping)$ {
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_pass unix:/run/php/php-fpm.sock;
|
|
}
|
|
} |