1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 16:40:05 +01:00

fix for share of secured sites

This commit is contained in:
Sergio Bruder
2018-09-14 03:39:33 -03:00
parent 029b2d7633
commit ac7b371d49
2 changed files with 48 additions and 3 deletions

View File

@@ -41,3 +41,39 @@ server {
deny all; 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;
}
}

11
valet
View File

@@ -41,9 +41,18 @@ then
fi fi
done done
# 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... # Fetch Ngrok URL In Background...
bash "$DIR/cli/scripts/fetch-share-url.sh" & bash "$DIR/cli/scripts/fetch-share-url.sh" &
sudo -u $(logname) "$DIR/bin/ngrok" http "$HOST.$TLD:80" -host-header=rewrite ${*:2} sudo -u $(logname) "$DIR/bin/ngrok" http "$HOST.$TLD:$PORT" -host-header=rewrite ${*:2}
exit exit
# Finally, for every other command we will just proxy into the PHP tool # Finally, for every other command we will just proxy into the PHP tool