Report this

What is the reason for this report?

how to setup two project in nginx ?

Posted on July 22, 2019
coci

By coci

hello guys :

i have one vps for two site .

imaging i have www.example.com , i want when user enter www.example.com this route open wordpress and in www.example.com/page1 this route open django project , how i configure that ?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

Hello,

You could use a reverse proxy to do that.

So in your server block you could add something like this:

location ~/page1(.*)$ {
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    proxy_pass http://yourjangoproject.com:8001$1;
}

Hope that this helps! Bobby

thank you bro

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.