Skip to content

Instantly share code, notes, and snippets.

@devifr
Created October 27, 2017 02:34
Show Gist options
  • Select an option

  • Save devifr/5e01800d009f2d83ccaa9cdb1b910805 to your computer and use it in GitHub Desktop.

Select an option

Save devifr/5e01800d009f2d83ccaa9cdb1b910805 to your computer and use it in GitHub Desktop.
server {
listen 80;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /home/deployphp/bit-website;
# Useful logs for debug.
access_log /home/deployphp/bit-website/access.log;
error_log /home/deployphp/bit-website/error.log;
rewrite_log on;
server_name mylaravel.app;
# Point index to the Laravel front controller.
index index.php index.html index.htm;
location / {
# URLs to attempt, including pretty ones.
try_files $uri $uri/ /index.php?$query_string;
error_page 404 /404.html;
error_page 403 /403.html;
# To allow POST on static pages
error_page 405 =200 $uri;
}
# PHP FPM configuration.
location ~* \.php$ {
# for multi php-fpm, it would be different:
# fastcgi_pass unix:/var/run/php/php5-fpm.sock; # php 5.5
# fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; # php 5.6
# fastcgi_pass unix:/var/run/php/php7-fpm.sock; # php 7.0
# fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; # php 7.1
# fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; # php 7.2
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Set header expirations on per-project basis
location ~* \.(?:bmp|ico|css|javascript|js|jpeg|jpg|png|tiff|svg|woff|flash|media|static)$ {
expires 365d;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}
Add Comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment