cpereiraweb
12/27/2016 - 5:41 PM

site_do_nginx.conf

# HTTP Application

server {
    
    # Application Path
    root /path/to/app/public/path;

    # Index Application File
    index index.php;

    # Listen to hosts
    server_name app.com www.app.com *.app.com;

    # Enable IPv4
    listen 80;
    # Enable IPv6
    listen [::]:80;

    # URL Rewrite Rules
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    # PHP Backend Config
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.0-fpm-myapp.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

}