How to Set Up an Nginx Reverse Proxy for Apache
Тәжірибелік нұсқаулар және стиль
Learn how to set up an Nginx reverse proxy for Apache in this tutorial that will show you how configure proxy_pass and the appropriate headers for your website.
Code snippets and more at tonyteaches.tech/nginx-revers...
Check out my vlog channel @TonyFlorida
#nginx #apache #reverseproxy
Пікірлер: 76
The explanation is spot on !!!!
Omg thank you! I threw in the towel on coding after not being able to get my reverse proxy working properly. I picked it back up today and this was huge! TYSM!
@TonyTeachesTech
3 жыл бұрын
Glad it helped!
Good explanation. Thanks.
@TonyTeachesTech
3 жыл бұрын
You're welcome!
That was Sweet explanation man keep it up Thanks
@TonyTeachesTech
3 жыл бұрын
Thanks, will do!
Thanks
Great content.
@TonyTeachesTech
3 жыл бұрын
Appreciate it Darrin :)
Obrigado, amigo
Would this allow for example to gave wordpress and ghost on the same droplet? Can you do a video of having wordpress and ghost installs on same server (WP using Apache and ghost using nginx)?
So, how do I do this with Docker for ease of development between a live server and localhost?
Thanks very much
@TonyTeachesTech
3 жыл бұрын
You are welcome
I have a quiestion, is ngnix installed on the same server you have the application running on, or is ngnix running by itself on a separate server
Hi Tony, i am on hostinger vps plan 1, 1GB of ram and 20 GB disk space so is this enough to run 2 websites with this setup?
Hello, i have nuxt and nginx install and working but when i go to different request than the main, nginx show "Not found 404", i think that is because of proxy_pass. How i can solve it ? How i can get request path and variabels from request to change in proxy_pass.
Thank you.
@TonyTeachesTech
2 жыл бұрын
You're welcome!
This is honestly the way to go if you're gonna be doing any type of dynamic content but wanna retain the speed and use of NGINX. Apache on the backend, NGINX on the front.
@TonyTeachesTech
3 жыл бұрын
Nginx FTW
How do you setup an NGINX reverse proxy for Apache2 on SSL port 443?
hey Tony, That was a nice explanation. Moreover, I am into the backend (Java) Development and wished to start learning dev-ops-related concepts. so do we have a designed series for it?
@TonyTeachesTech
3 жыл бұрын
Like java server pages?
Great tutorials! How don't you have more subscribers?
@TonyTeachesTech
3 жыл бұрын
Working on it!
Hello Tony. I know that I am a little late getting to the party so-to-speak. Your presentation was clear and precise. Thank you for sharing your time and expertise with us. Followed your instructions to the letter. However, I still have to use the :8888 after the URL. If I simply enter the URL I am directed to another server that I am running here at my place. It is hosting several websites under HestiaCP.
@TonyTeachesTech
2 жыл бұрын
I have no idea why that's happening ??
@charlesbenca5357
2 жыл бұрын
did you allow nginx in the firewall? im not on debian, but i've seen in the video ufw showing up after a package installation.
@PeterBatah
2 жыл бұрын
@@charlesbenca5357 Thank you Charles. I will have to check that out. Much appreciated.
Hello Tony, I just built the same Infrastructure as you did just locally on VirtualBox and without a domain configured (everything is running on localhost). Somehow I’m still able to access the website over the port 80 and 8080, even with the virtualhost configured only on 8080 and listening to 8080. Do you have any idea how I can solve the problem? How are you able to see if the client is accessing the reverse proxy or directly the webservice? Great content btw. Greetings
@TonyTeachesTech
3 жыл бұрын
Hi Aleksandar. I understand your concern. Please update /etc/apache2/ports.conf to only listen for requests on localhost... Listen 127.0.0.1:8080
now i can flex on my recruiters
Hi Tony, based on this kind of setup (nginx as reverse proxy with apache web server), does this mean that when I configure my Wordpress, it will be hosted by apache? I hope you get to see my comment/question and your video really inspired me to dive-in to debian. Thanks and more power!!!
@TonyTeachesTech
Жыл бұрын
Yes, Apache will continue to do the heavy lifting behind Nginx. Enjoy your time in the Debian world :)
Hi Tony one question if I do a reverse proxy will this secure my main server.
@TonyTeachesTech
2 жыл бұрын
Potentially some if your main server is on another IP
where I can add 301 redirects after setting proxy server for caching.
@TonyTeachesTech
3 жыл бұрын
That would be in your nginx conf file
Thank you so much, Tony! Can I set the Apache server name to Domain?
@TonyTeachesTech
3 жыл бұрын
Yes, absolutely
@yohanbyun1008
3 жыл бұрын
@@TonyTeachesTech Thank you. I want to process only Php requests in apache and set up nginx to handle the rest of the static elements, but I don't know how to set it up in detail. Is there a way to proxy only Php?
can nginx proxy manager be used without portforwarding??
@TonyTeachesTech
3 жыл бұрын
Perhaps with a socket
Hi sir, Can I use Nginx reverse proxy for Apache and redis cache together?
@TonyTeachesTech
3 жыл бұрын
Yes, you can
@tutorplus4228
3 жыл бұрын
@@TonyTeachesTech Thanks
nginx -s reload, sends a reloading signal to the server without restarting the whole server which avoids any downtime!
hello Tony, I am runing nginx and apache2 on the same server ubuntu 20.4. 1 site is runing on mydomain.com and second on mydomain/moodle. but my problem is I can not run them at the same time. I can not start apache when nginx is runing or run nginx when apache is runing. So I have to stop the one to run the second. how can I make them runing without pause one? could you help?
@TonyTeachesTech
3 жыл бұрын
There should be no problem to run Apache and Nginx side by side. What error message do you get when you try to run them simultaneously?
@christkant
3 жыл бұрын
@@TonyTeachesTech when runing nginx and I want to start apache2, I am getting the following message(Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. failed! ) using: sudo /etc/init.d/apache2 restart Then when I stop nginx then restart apache, it will start but when runing apache and if I want to start nginx the following I am getting the following message(Restarting nginx (via systemctl): nginx.serviceJob for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. failed!) using: sudo /etc/init.d/nginx restart.
@TonyTeachesTech
3 жыл бұрын
@@christkant This could be syntax errors. Please see this video and let me know if that helps kzread.info/dash/bejne/doeEt7JuhL3KaaQ.html
@christkant
3 жыл бұрын
@@TonyTeachesTech thanks that helps
@mrpoliticalguy5602
3 жыл бұрын
@@christkant I think it's conflicting on the same port maybe put apache2 on 8080 and get nginx to redirect to apache2.
HEEEEYYYY. WHATS YOUR NAAAAME???? TONYYYYY!!!!!
I expose my localhost to the internet with ngrok cause I don't want to port forward. instead of putting my ip in the nginx server can I put the ngrok domain instead?. Pls answer.
@TonyTeachesTech
3 жыл бұрын
What is the question?
@mrpoliticalguy5602
3 жыл бұрын
@@TonyTeachesTech so when nginx redirects to my website I put My IP but can I put instead example:ngrok.ydhjg.io could I put a domain instead of IP in the nginx configuration file.
@TonyTeachesTech
3 жыл бұрын
@@mrpoliticalguy5602 Oh yes, that will be okay
@mrpoliticalguy5602
3 жыл бұрын
@@TonyTeachesTech thank you.
@mrpoliticalguy5602
3 жыл бұрын
@@TonyTeachesTech hi so your not fimilur with ngrok what I mean is instead of port forwarding forward your web server through ssh tunneling to another server which will hide my IP address would that protect you from ddos.
I’m having so many issues
Whatever you just said in your video I have followed all the steps but it still not working
@TonyTeachesTech
2 жыл бұрын
Uh oh. What went wrong?
it's showing for me 403 forbidden
@TonyTeachesTech
3 жыл бұрын
Please see if the tips in this video help kzread.info/dash/bejne/YmWIl6yDd7qaj8Y.html
im still lost in VIM.... HELP!!!
@TonyTeachesTech
Жыл бұрын
Watch this kzread.info/dash/bejne/p3low86jn7Colco.html
This will hide my real ip ????
@TonyTeachesTech
3 жыл бұрын
It will "hide" your website's IP address behind the proxy
it says bad gateway
@TonyTeachesTech
3 жыл бұрын
Please see if the solutions from this video help you kzread.info/dash/bejne/mo2K1MuBkpeZp7g.html