Files
api/services/nginx/nginx.conf
T
Jepp9350 60bcbb6e75 Enhance invoice handling and filtering mechanisms
Refactored invoice draft handling to improve error checks, added support for optional fetch skipping, and enhanced currency management. Expanded filtering capabilities with date range and attribute-based filters. Adjusted Nginx config to increase FastCGI read timeout for long-running processes.
2025-04-07 07:43:47 +02:00

89 lines
2.4 KiB
Nginx Configuration File

# Main Nginx Configuration File
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Include additional configuration files
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Log settings
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Gzip settings (optional)
gzip on;
gzip_types text/plain application/xml text/css application/javascript;
# Include server block configurations
include /etc/nginx/conf.d/*.conf;
# Redirect HTTP to HTTPS
server {
listen 80;
server_name api.truckwash.dk;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name api.truckwash.dk;
# SSL certificates
ssl_certificate /etc/letsencrypt/live/api.truckwash.dk/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.truckwash.dk/privkey.pem;
# Enable SSL options
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
# Logging
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log combined;
# Index file
index index.php index.html index.htm;
# Root directory (public- uses index.php)
root /var/www/html;
# Location block for PHP files
location ^~ / {
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE";
add_header Access-Control-Allow-Headers "Authorization, Content-Type, X-Requested-With";
add_header Access-Control-Allow-Credentials true;
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS, PUT, DELETE";
add_header Access-Control-Allow-Headers "Authorization, Content-Type, X-Requested-With";
return 204;
}
include fastcgi_params;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_read_timeout 600;
fastcgi_param SCRIPT_FILENAME index.php;
}
# Deny access to .htaccess files
location ~ /\.ht {
deny all;
}
# Deny access to hidden files
location ~ /\. {
deny all;
}
}
}