Last active
March 30, 2018 12:59
-
-
Save Shipu/71e96af09565f17868b0d107836e1883 to your computer and use it in GitHub Desktop.
Automatic Virtual host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name ~^(www\.)?(?<sname>.+?)$; | |
root /var/www/html/$sname; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
access_log /var/www/html/$sname-access.log; | |
error_log /var/www/html/error.log debug; | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/run/php/php7.1-fpm.sock; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name ~^(www\.)?(?<sname>.+?)\.lrvl$; | |
root /var/www/html/laravel/$sname/public; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
# public files | |
location /storage { | |
alias /var/www/html/laravel/$sname/storage/app/public; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
access_log /var/www/html/laravel/$sname-access.log; | |
error_log /var/www/html/laravel/error.log debug; | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/run/php/php7.1-fpm.sock; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name ~^(www\.)?(?<sname>.+?)\.master$; | |
root /var/www/html/default/$sname; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
access_log /var/www/html/default/$sname-access.log; | |
error_log /var/www/html/default/error.log debug; | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
fastcgi_pass unix:/run/php/php7.1-fpm.sock; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
sudo ln -s /etc/nginx/sites-available/laravel-wildcard-nginx.conf /etc/nginx/sites-enabled/laravel-wildcard-nginx.conf && sudo service nginx restart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/perusio/nginx_ensite