Skip to content

Instantly share code, notes, and snippets.

@nxvhm
Created February 16, 2019 09:48
Show Gist options
  • Save nxvhm/613970389064309c3c45349e2a0f3332 to your computer and use it in GitHub Desktop.
Save nxvhm/613970389064309c3c45349e2a0f3332 to your computer and use it in GitHub Desktop.
nginx fpm vhost configs for laravel/phpmyadmin for local dev
server {
listen 80;
server_name laravel-project.local;
root /vagrant/code/laravel-project/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
}
location ~ /\.ht {
deny all;
}
location ~ /.well-known {
allow all;
}
}
server {
listen 80;
#listen [::]:80 default_server;
root /vagrant/code/phpmyadmin;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name phpmyadmin.local www.phpmyadmin.local;
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment