Files
emails/api/nginx.conf

38 lines
1.6 KiB
Nginx Configuration File
Raw Normal View History

2022-11-09 15:17:02 -03:00
server {
2023-06-12 21:14:07 -04:00
listen 81;
2022-11-09 15:17:02 -03:00
root /app/api/public;
index index.php index.html index.htm;
2023-06-12 21:14:07 -04:00
access_log /var/logs/nginx/api.access.log;
error_log /var/logs/nginx/api.error.log;
2022-11-09 15:17:02 -03:00
location / {
2023-06-12 21:14:07 -04:00
try_files $uri /index.php$is_args$args;
2022-11-09 15:17:02 -03:00
}
2023-06-12 21:14:07 -04:00
location ~ \.php {
2022-11-09 15:17:02 -03:00
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'application/json';
add_header 'Content-Length' 0;
return 204;
}
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
2023-06-12 21:14:07 -04:00
include fastcgi_params;
2022-11-09 15:17:02 -03:00
fastcgi_pass api:9000;
fastcgi_index index.php;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2023-06-12 21:14:07 -04:00
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
2022-11-09 15:17:02 -03:00
fastcgi_param PATH_INFO $fastcgi_path_info;
}
2023-06-12 21:14:07 -04:00
}