PHP Classes
elePHPant
Icontem

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: 4 months ago
Size: 1,154 bytes
 

 

Contents

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 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root   FOLDER_DIR/public;
        fastcgi_pass   127.0.0.1:9000;
        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;
    }
}