homestead
homestead copied to clipboard
Add new site type for webman framework
/cc @mouyong
Resolves https://github.com/laravel/homestead/issues/1764
Example configuration:
sites:
- map: vcdt.test
to: /home/vagrant/vcdt/public
type: webman
webman_port: 9393
Results in the following virutalhost:
upstream webman {
server 127.0.0.1:9393;
}
server {
listen 80;
listen 443 ssl http2;
server_name .vcdt.test;
root "/home/vagrant/vcdt/public";
index index.html index.htm index.php;
charset utf-8;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
proxy_pass http://webman;
}
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/vcdt.test-error.log error;
sendfile off;
location ~ /\.ht {
deny all;
}
ssl_certificate /etc/ssl/certs/vcdt.test.crt;
ssl_certificate_key /etc/ssl/certs/vcdt.test.key;
}
maybe we can add new site type for hyperf, it also need use upstream_port:
you can see this link.
https://hyperf.wiki/2.2/#/zh-cn/tutorial/nginx
maybe we can add new site type for hyperf, it also need use upstream_port:
you can see this link.
If it's the same syntax as the webman
you can use that same type.
Possible upstream_port
than webman_port
is more suitable. Why not use it.
And we can also add the websocket_port
to variable 12 like this: site['websocket_port'] ||= $12, # $12
Possible
upstream_port
thanwebman_port
is more suitable. Why not use it.And we can also add the
websocket_port
to variable 12 like this:site['websocket_port'] ||= $12, # $12
If we're adding port configuration for a site type and we need to support multiple site types, we should do that in the site type. I don't want to add many inputs that only specific types need.
if site need websocket
, it can be use $12
,
if site need use upstream
to listen application, it can be use $11
.
And the webman_port
can only be used for webman framework. From a semantic point of view.
And webman_port
is a PHP framework setting, and the upstream_port
and the websocket_port
are nginx settings.
Apologies, I haven't forgotten about this.
Closing this as I completely neglected it. if you'd like to PR a webman site type I'll happily review it.