mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 00:20:08 +01:00
fix for share of secured sites
This commit is contained in:
@@ -41,3 +41,39 @@ server {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 88;
|
||||
server_name VALET_SITE www.VALET_SITE *.VALET_SITE;
|
||||
root /;
|
||||
charset utf-8;
|
||||
client_max_body_size 128M;
|
||||
|
||||
location /VALET_STATIC_PREFIX/ {
|
||||
internal;
|
||||
alias /;
|
||||
try_files $uri $uri/;
|
||||
}
|
||||
|
||||
location / {
|
||||
rewrite ^ VALET_SERVER_PATH last;
|
||||
}
|
||||
|
||||
access_log off;
|
||||
error_log VALET_HOME_PATH/Log/nginx-error.log;
|
||||
|
||||
error_page 404 VALET_SERVER_PATH;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:VALET_HOME_PATH/valet.sock;
|
||||
fastcgi_index VALET_SERVER_PATH;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME VALET_SERVER_PATH;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
15
valet
15
valet
@@ -41,9 +41,18 @@ then
|
||||
fi
|
||||
done
|
||||
|
||||
# Fetch Ngrok URL In Background...
|
||||
bash "$DIR/cli/scripts/fetch-share-url.sh" &
|
||||
sudo -u $(logname) "$DIR/bin/ngrok" http "$HOST.$TLD:80" -host-header=rewrite ${*:2}
|
||||
# Decide the correct PORT to use according if the site has a secure
|
||||
# config or not.
|
||||
if grep 443 "~/.config/valet/Nginx/$HOST*"
|
||||
then
|
||||
PORT=88
|
||||
else
|
||||
PORT=80
|
||||
fi
|
||||
|
||||
# Fetch Ngrok URL In Background...
|
||||
bash "$DIR/cli/scripts/fetch-share-url.sh" &
|
||||
sudo -u $(logname) "$DIR/bin/ngrok" http "$HOST.$TLD:$PORT" -host-header=rewrite ${*:2}
|
||||
exit
|
||||
|
||||
# Finally, for every other command we will just proxy into the PHP tool
|
||||
|
||||
Reference in New Issue
Block a user