upstream php-fpm {
server unix:/var/run/php-fpm/www.sock;
}
server {
listen 80;
server_name flashshop.ge www.flashshop.ge
return 301 https://flashshop.ge$request_uri;
}
server {
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
server_name flashshop.ge www.flashshop.ge;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
root /home/flashshop.ge/html;
index index.php;
client_max_body_size 100M;
access_log /var/log/nginx/flashshop_access.log main;
error_log /var/log/nginx/flashshop_error.log;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
# This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass php-fpm;
#The following parameter can be also included in fastcgi_params file
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}