Skip to content

Instantly share code, notes, and snippets.

@rogeriolino
Created August 24, 2016 01:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rogeriolino/32ef15b7a0b9e2745e5f69f816ca8a9f to your computer and use it in GitHub Desktop.
Save rogeriolino/32ef15b7a0b9e2745e5f69f816ca8a9f to your computer and use it in GitHub Desktop.
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
Copy link

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