@@ -28,74 +28,17 @@ http {
2828 uwsgi_temp_path /tmp/uwsgi_temp;
2929 scgi_temp_path /tmp/scgi_temp;
3030
31- # Default server definition
32- server {
33- listen [::]:8080 default_server;
34- listen 8080 default_server;
35- server_name _;
36-
37- sendfile off;
38- tcp_nodelay on;
39- absolute_redirect off;
40-
41- root /var/www/html;
42- index index .php index .html;
43-
44- location / {
45- # First attempt to serve request as file, then
46- # as directory, then fall back to index.php
47- try_files $uri $uri / /index .php?q=$uri &$args ;
48- }
49-
50- # Redirect server error pages to the static page /50x.html
51- error_page 500 502 503 504 /50x .html;
52- location = /50x .html {
53- root /var/lib/nginx/html;
54- }
55-
56- # Pass the PHP scripts to PHP-FPM listening on php-fpm.sock
57- location ~ \.php$ {
58- try_files $uri =404 ;
59- fastcgi_split_path_info ^( .+\.php)( /.+) $;
60- fastcgi_pass unix:/run/php-fpm.sock;
61- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name ;
62- fastcgi_param SCRIPT_NAME $fastcgi_script_name ;
63- fastcgi_index index .php;
64- include fastcgi_params;
65- }
66-
67- location ~ * \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
68- expires 5d ;
69- }
70-
71- # Deny access to . files, for security
72- location ~ /\. {
73- log_not_found off;
74- deny all;
75- }
76-
77- # Allow fpm ping and status from localhost
78- location ~ ^/( fpm-status |fpm-ping) $ {
79- access_log off;
80- allow 127.0.0.1 ;
81- deny all;
82- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name ;
83- include fastcgi_params;
84- fastcgi_pass unix:/run/php-fpm.sock;
85- }
86- }
87-
8831 # Hardening
8932 proxy_hide_header X-Powered-By;
9033 fastcgi_hide_header X-Powered-By;
9134 server_tokens off;
92-
35+
9336 gzip on;
9437 gzip_proxied any;
9538 gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;
9639 gzip_vary on;
9740 gzip_disable "msie6" ;
98-
41+
9942 # Include other server configs
10043 include /etc/nginx/conf.d/*.conf;
10144}
0 commit comments