Last active
May 31, 2021 06:19
-
-
Save itechnotion/f10d351dbfd7f5b98247763a78b0728e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
root /var/www/website/public_html/; | |
access_log /var/www/website/logs/access.log; | |
error_log /var/www/website/logs/error.log; | |
index index.php index.html index.htm; | |
server_name website.com www.website.com; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
error_page 404 /404.html; | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /var/www/errors; | |
} | |
location ~ .php$ { | |
try_files $uri =404; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
# enable levarage browser caching | |
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { | |
expires 365d; | |
} | |
location ~* \.(pdf)$ { | |
expires 30d; | |
} | |
#vary-accept-encoding-header-nginx | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 32k; | |
gzip_types text/plain application/x-javascript text/xml text/css; | |
gzip_vary on; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment