Last active
October 26, 2020 05:45
-
-
Save nguyenhiepvan/b4b85234df93df9f7447ebd05c592330 to your computer and use it in GitHub Desktop.
Automation vitural host laravel
This file contains hidden or 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
UseCanonicalName Off | |
<VirtualHost *:80> | |
ServerName vhosts.fqdn | |
ServerAlias *.local.com | |
VirtualDocumentRoot /var/www/laravel/%1/public | |
<Directory ~ "/var/www/laralve/%1/public"> | |
Options Indexes FollowSymlinks MultiViews | |
AllowOverride All | |
Require all granted | |
<FilesMatch "\.php$"> | |
Require all granted | |
SetHandler proxy:fcgi://127.0.0.1:9000 | |
</FilesMatch> | |
</Directory> | |
</VirtualHost> |
This file contains hidden or 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>.+?).local.com$; | |
root /var/www/laravel/$sname/public; | |
index index.php index.html index.htm; | |
charset utf-8; | |
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/log/nginx/$sname-access.log; | |
error_log /var/log/nginx/laravel-default-error.log debug; | |
error_page 404 /index.php; | |
sendfile off; | |
# Remove trailing slash to please routing system. | |
if (!-d $request_filename) { | |
rewrite ^/(.+)/$ /$1 permanent; | |
} | |
location ~ \.php$ { | |
try_files $uri /index.php =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/run/php/php7.4-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
location ~ /\.ht { deny all; }
cái này mà muốn để uri dạng abc.html là chết nè
/.ht chỉ nhận /.htaccess /.http ... chứ ko nhận /index.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cái này mà muốn để uri dạng abc.html là chết nè