2024-01-18 15:35:45 +00:00
|
|
|
map $original_uri $api_uri {
|
|
|
|
~^/api(/.*$) $1;
|
|
|
|
default $original_uri;
|
|
|
|
}
|
|
|
|
|
2023-07-27 09:34:19 +00:00
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name opnform;
|
|
|
|
root /app/public;
|
|
|
|
|
|
|
|
access_log /dev/stdout;
|
|
|
|
error_log /dev/stderr error;
|
|
|
|
|
|
|
|
index index.html index.htm index.php;
|
|
|
|
|
|
|
|
location / {
|
2024-01-18 15:35:45 +00:00
|
|
|
proxy_pass http://localhost:3000;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /api/ {
|
|
|
|
set $original_uri $uri;
|
|
|
|
try_files $uri $uri/ /index.php$is_args$args;
|
2023-07-27 09:34:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
location ~ \.php$ {
|
|
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
|
|
fastcgi_pass unix:/var/run/php-fpm-opnform-site.sock;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
include fastcgi.conf;
|
2024-01-18 15:35:45 +00:00
|
|
|
fastcgi_param REQUEST_URI $api_uri;
|
|
|
|
}
|
2023-07-27 09:34:19 +00:00
|
|
|
}
|
|
|
|
|