Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NovoSGA Nginx
server {
listen 80;
root /var/www/novosga/;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ /public/index.php?$query_string;
}
# PHP
location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}
@lucastravagin

This comment has been minimized.

Copy link

commented Mar 11, 2019

Boa noite, estou precisando de uma ajuda. Será que você conseguir me ajudar?
Esse é o meu Server Block, quando eu solicito na url paineldigital.com.br, me retorna 502. Nunca configurei nada relacionado a PHP.

server {
listen 80;

root /var/www/paineldigital.digimedic.com.br/html/novosga/;
index index.php index.html index.htm index.nginx-debian.html;

server_name paineldigital.digimedic.com.br;

location / {
    try_files $uri $uri/ /public/index.php?$query_string;
}

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php5-fpm.sock;
}

location ~ /\.ht {
    deny all;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.