PHP Classes

File: nginx_conf/example.conf

Recommend this page to a friend!
  Classes of Ankit Jain  >  Laravel Nginx Configuration  >  nginx_conf/example.conf  >  Download  
File: nginx_conf/example.conf
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel Nginx Configuration
Create a Virtualhost in nginx for a Laravel site
Author: By
Last change:
Date: 3 years ago
Size: 1,154 bytes


Class file image Download
# another virtual host using mix of IP-, name-, and port-based configuration
server {
    listen       80;
    server_name  SERVER_ALIAS;
    location / {
        root   FOLDER_DIR/public;
        index  index.php index.html index.htm;
	try_files $uri $uri/ /index.php?$query_string;

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;

    # proxy the PHP scripts to Apache listening on
    #location ~ \.php$ {
    #    proxy_pass;

    # pass the PHP scripts to FastCGI server listening on
    location ~ \.php$ {
        root   FOLDER_DIR/public;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        /usr/local/etc/nginx/fastcgi_params;

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    location ~ /\.ht {
        deny  all;
For more information send a message to info at phpclasses dot org.