1
+ server {
2
+ listen 44380;
3
+ listen [::]:44380;
4
+ server_name _;
5
+ return 301 https://$host$request_uri;
6
+ }
7
+
8
+ server {
9
+ set $serverName web.local;
10
+ set $appRoot /var/www;
11
+ set $docRoot $appRoot/public;
12
+ set $indexPrefix index;
13
+
14
+ listen 80;
15
+ listen [::]:80;
16
+ listen 443 ssl http2;
17
+ listen [::]:443 ssl http2;
18
+
19
+ ssl_certificate /etc/http-certs/cert.crt;
20
+ ssl_certificate_key /etc/http-certs/cert.key;
21
+ ssl_dhparam /etc/http-certs/dhparam.pem;
22
+ ssl_session_timeout 1d;
23
+ ssl_session_cache shared:MozSSL:10m;
24
+ ssl_session_tickets off;
25
+ ssl_protocols TLSv1.2 TLSv1.3;
26
+ 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;
27
+ ssl_prefer_server_ciphers on;
28
+ ssl_stapling on;
29
+ ssl_stapling_verify on;
30
+
31
+ server_name $serverName;
32
+ root $docRoot;
33
+
34
+ gzip on;
35
+ gzip_vary on;
36
+ gzip_proxied any;
37
+ gzip_types text/plain text/css application/xml application/xhtml+xml application/rss+xml application/json application/javascript application/x-javascript image/svg+xml;
38
+
39
+ location / {
40
+ try_files $uri /$indexPrefix.php$is_args$args;
41
+ }
42
+
43
+ location ^~ /.well-known/ {
44
+ allow all;
45
+ }
46
+
47
+ location ~* \.(jpg|jpeg|png|gif|ico)$ {
48
+ log_not_found off;
49
+ access_log off;
50
+ }
51
+
52
+ location ~ \.php(/|$) {
53
+ fastcgi_pass php-fpm:9000;
54
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
55
+ fastcgi_index $indexPrefix.php;
56
+ include fastcgi_params;
57
+
58
+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
59
+ fastcgi_param DOCUMENT_ROOT $realpath_root;
60
+
61
+ fastcgi_buffers 8 16k;
62
+ fastcgi_buffer_size 32k;
63
+ fastcgi_read_timeout 240;
64
+ proxy_connect_timeout 10;
65
+ proxy_send_timeout 300;
66
+ proxy_read_timeout 300;
67
+ }
68
+
69
+ # return 404 for all other php files not matching the front controller
70
+ # this prevents access to other php files you don't want to be accessible.
71
+ location ~ \.php$ {
72
+ return 404;
73
+ }
74
+
75
+ error_log /var/log/nginx/error.log;
76
+ access_log /var/log/nginx/access.log;
77
+ }
0 commit comments