1- # Nginx configuration
2- 
3- # HTTP Server
4- server {
5-     listen 80 default_server;
6-     listen [::]:80 default_server;
7-     server_name localhost;
8- 
9-     # Logging
10-     access_log /var/log/nginx/access.log;
11-     error_log /var/log/nginx/error.log;
12- 
13-     # Root directory and index files
14-     root /var/www/html/app/public;
15-     index index.php index.html;
16- 
17-     # Framework specific configuration
18-     include /etc/nginx/conf.d/framework/default.conf;
19- 
20-     # PHP-FPM Configuration
21-     location ~ \.php$ {
22-         try_files $uri =404;
23-         fastcgi_split_path_info ^(.+\.php)(/.+)$;
24-         fastcgi_pass php:9000;
25-         fastcgi_index index.php;
26-         include fastcgi_params;
27-         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
28-         fastcgi_param PATH_INFO $fastcgi_path_info;
29-     }
30- 
31-     # Deny access to hidden files
32-     location ~ /\. {
33-         deny all;
34-     }
35- 
36-     # Deny access to specific directories
37-     location ~ ^/(vendor|tests|src|app)/ {
38-         deny all;
39-         return 404;
40-     }
41- 
42-     # Optimize static file serving
43-     location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
44-         expires 30d;
45-         add_header Cache-Control "public, no-transform";
46-     }
47- }
48- 
49- # HTTPS Server (uncomment to enable SSL)
50- # server {
51- #     listen 443 ssl http2;
52- #     listen [::]:443 ssl http2;
53- #     server_name localhost;
54- #
55- #     # SSL Configuration
56- #     ssl_certificate /etc/ssl/server.crt;
57- #     ssl_certificate_key /etc/ssl/server.key;
58- #     
59- #     # Modern SSL settings
60- #     ssl_protocols TLSv1.2 TLSv1.3;
61- #     ssl_prefer_server_ciphers on;
62- #     ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
63- #     ssl_session_cache shared:SSL:10m;
64- #     ssl_session_timeout 1d;
65- #     ssl_session_tickets off;
66- #
67- #     # Root directory and index files
68- #     root /var/www/html/app/public;
69- #     index index.php index.html;
70- #
71- #     # Logging
72- #     access_log /var/log/nginx/access.log;
73- #     error_log /var/log/nginx/error.log;
74- #
75- #     # Framework specific configuration
76- #     include /etc/nginx/framework/default.conf;
77- #
78- #     # PHP-FPM Configuration
79- #     location ~ \.php$ {
80- #         try_files $uri =404;
81- #         fastcgi_split_path_info ^(.+\.php)(/.+)$;
82- #         fastcgi_pass php:9000;
83- #         fastcgi_index index.php;
84- #         include fastcgi_params;
85- #         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
86- #         fastcgi_param PATH_INFO $fastcgi_path_info;
87- #         fastcgi_param HTTPS on;
88- #     }
89- #
90- #     # Deny access to hidden files
91- #     location ~ /\. {
92- #         deny all;
93- #     }
94- #
95- #     # Deny access to specific directories
96- #     location ~ ^/(vendor|tests|src|app)/ {
97- #         deny all;
98- #         return 404;
99- #     }
100- #
101- #     # Optimize static file serving
102- #     location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
103- #         expires 30d;
104- #         add_header Cache-Control "public, no-transform";
105- #     }
106- # }
0 commit comments