-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing vhost from host only works with port forwarding #4
Comments
I'm seeing this, too. I believe it's some misconfiguration with Apache. I'll look into it.
This sounds like the
Again, As a side note, you don't have to choose between config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.vm.network :private_network, ip: 192.168.5.22 I'll start troubleshooting what may be going on here, but showing me the Vagrantfile config for each scenario would help a lot, just so I know for sure I'm getting the same results you are. Thanks! |
I did a little digging on the 403 error and found the following error message to be pretty descriptive:
So evidently there's a rule in place somewhere that kills requests that identify the host by IP. |
I've been testing different networking configurations for vagrant so that I can access the guest server from a browser on the host machine. So far, the only thing I've gotten to work is if I use
config.vm.network :forwarded_port, guest: 80, host: 4321
, and then access http://localhost:4321 in a browser.If I try to access 127.0.0.1:4321 in a browser, I get a 403 forbidden error. If I use a private_network setup with a hostname instead of forwarded_port, I get the same 403 error when accessing by IP, but accessing by the set hostname gets me Apache's default host (files in /usr/local/apache2/htdocs).
Ideally I would like to use a local hostname like dreambox.dev so that the project I'm working on can pretend that it has a hostname, but I haven't been able to figure out how to change apache's vhost configuration so that the /home/user DocumentRoot is served in all instances. I think that would be best because we can't guess at which networking configuration people will try to use.
The text was updated successfully, but these errors were encountered: