N
N
Nicholas Secret2017-04-23 11:31:55
Nginx
Nicholas Secret, 2017-04-23 11:31:55

How to redirect all requests from nginx to xampp?

I googled googled working answer didn't google it.
It turns out that there is an nginx server on the Internet and a group of sites with php-fpm. Everything is working. The server has two interfaces, the first looks to the Internet, and the second to the local network. There is another server on the network that runs XAMPP, which runs a special site that runs only on apache, well, maybe not, but I can’t set it up on Nginx + php-fpm, and I don’t want to.
I want that when I go to the xampp.example.com address, ngnix either redirects me to the server with xampp and I already climb the site there, or go there and take the requested page and give it to me.
googled like this

server {
listen 80;
sever_name xampp.example.com;

location / {
proxy_pass http://192.168.0.5:80/html/;
}
}

And here I get pure html, even without CSS and without graphics. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IsaevDev, 2017-04-23
@IsaevDev

you get pure html without graphics, most likely because in the url of images and css your path goes from the root, and when proxying you add /html/
, that is, /img/share/...
you can try relative paths img/ share...
or on Apache create an alias to /html/ and specify the root of the site

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question