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

  • @harish-tw4zt
    @harish-tw4zt Жыл бұрын

    The explanation is spot on !!!!

  • @mSpinks01
    @mSpinks013 жыл бұрын

    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

    @TonyTeachesTech

    3 жыл бұрын

    Glad it helped!

  • @rakeshpk4991
    @rakeshpk49913 жыл бұрын

    Good explanation. Thanks.

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    You're welcome!

  • @rusiruathukorala5893
    @rusiruathukorala58933 жыл бұрын

    That was Sweet explanation man keep it up Thanks

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Thanks, will do!

  • @MuhammadRafliYulistiawan
    @MuhammadRafliYulistiawan4 ай бұрын

    Thanks

  • @wnywebdevelopment8757
    @wnywebdevelopment87573 жыл бұрын

    Great content.

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Appreciate it Darrin :)

  • @allefsilva8849
    @allefsilva88497 ай бұрын

    Obrigado, amigo

  • @s2root786
    @s2root7862 ай бұрын

    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)?

  • @WiserRhinoDesigns
    @WiserRhinoDesigns8 ай бұрын

    So, how do I do this with Docker for ease of development between a live server and localhost?

  • @amandeepsingh7873
    @amandeepsingh78733 жыл бұрын

    Thanks very much

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    You are welcome

  • @anthonysantana4278
    @anthonysantana4278 Жыл бұрын

    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

  • @petertremblay3725
    @petertremblay37252 жыл бұрын

    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?

  • @p-tropa9936
    @p-tropa9936 Жыл бұрын

    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.

  • @aomo5293
    @aomo52932 жыл бұрын

    Thank you.

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    You're welcome!

  • @madezra64
    @madezra643 жыл бұрын

    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

    @TonyTeachesTech

    3 жыл бұрын

    Nginx FTW

  • @gabrielferrer2400
    @gabrielferrer2400 Жыл бұрын

    How do you setup an NGINX reverse proxy for Apache2 on SSL port 443?

  • @vatsalvalecha6182
    @vatsalvalecha61823 жыл бұрын

    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

    @TonyTeachesTech

    3 жыл бұрын

    Like java server pages?

  • @DM-vu6he
    @DM-vu6he3 жыл бұрын

    Great tutorials! How don't you have more subscribers?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Working on it!

  • @PeterBatah
    @PeterBatah2 жыл бұрын

    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

    @TonyTeachesTech

    2 жыл бұрын

    I have no idea why that's happening ??

  • @charlesbenca5357

    @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

    @PeterBatah

    2 жыл бұрын

    @@charlesbenca5357 Thank you Charles. I will have to check that out. Much appreciated.

  • @aleksandarradovanovic4838
    @aleksandarradovanovic48383 жыл бұрын

    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

    @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

  • @BananaLassi
    @BananaLassi Жыл бұрын

    now i can flex on my recruiters

  • @Jeremy42Nyt
    @Jeremy42Nyt Жыл бұрын

    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

    @TonyTeachesTech

    Жыл бұрын

    Yes, Apache will continue to do the heavy lifting behind Nginx. Enjoy your time in the Debian world :)

  • @mrpoliticalguy5602
    @mrpoliticalguy56022 жыл бұрын

    Hi Tony one question if I do a reverse proxy will this secure my main server.

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    Potentially some if your main server is on another IP

  • @nomanjaved6658
    @nomanjaved66583 жыл бұрын

    where I can add 301 redirects after setting proxy server for caching.

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    That would be in your nginx conf file

  • @yohanbyun1008
    @yohanbyun10083 жыл бұрын

    Thank you so much, Tony! Can I set the Apache server name to Domain?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Yes, absolutely

  • @yohanbyun1008

    @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?

  • @anirudhya_g
    @anirudhya_g3 жыл бұрын

    can nginx proxy manager be used without portforwarding??

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Perhaps with a socket

  • @tutorplus4228
    @tutorplus42283 жыл бұрын

    Hi sir, Can I use Nginx reverse proxy for Apache and redis cache together?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Yes, you can

  • @tutorplus4228

    @tutorplus4228

    3 жыл бұрын

    @@TonyTeachesTech Thanks

  • @cabbarserif1229
    @cabbarserif1229 Жыл бұрын

    nginx -s reload, sends a reloading signal to the server without restarting the whole server which avoids any downtime!

  • @christkant
    @christkant3 жыл бұрын

    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

    @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

    @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

    @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

    @christkant

    3 жыл бұрын

    @@TonyTeachesTech thanks that helps

  • @mrpoliticalguy5602

    @mrpoliticalguy5602

    3 жыл бұрын

    @@christkant I think it's conflicting on the same port maybe put apache2 on 8080 and get nginx to redirect to apache2.

  • @RebelSouls
    @RebelSouls Жыл бұрын

    HEEEEYYYY. WHATS YOUR NAAAAME???? TONYYYYY!!!!!

  • @mrpoliticalguy5602
    @mrpoliticalguy56023 жыл бұрын

    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

    @TonyTeachesTech

    3 жыл бұрын

    What is the question?

  • @mrpoliticalguy5602

    @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

    @TonyTeachesTech

    3 жыл бұрын

    @@mrpoliticalguy5602 Oh yes, that will be okay

  • @mrpoliticalguy5602

    @mrpoliticalguy5602

    3 жыл бұрын

    @@TonyTeachesTech thank you.

  • @mrpoliticalguy5602

    @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.

  • @0797cjm
    @0797cjm2 жыл бұрын

    I’m having so many issues

  • @santoshdangare2558
    @santoshdangare25582 жыл бұрын

    Whatever you just said in your video I have followed all the steps but it still not working

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    Uh oh. What went wrong?

  • @tocissp660
    @tocissp6603 жыл бұрын

    it's showing for me 403 forbidden

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Please see if the tips in this video help kzread.info/dash/bejne/YmWIl6yDd7qaj8Y.html

  • @SpencerTech
    @SpencerTech Жыл бұрын

    im still lost in VIM.... HELP!!!

  • @TonyTeachesTech

    @TonyTeachesTech

    Жыл бұрын

    Watch this kzread.info/dash/bejne/p3low86jn7Colco.html

  • @ELIAS-og5vf
    @ELIAS-og5vf3 жыл бұрын

    This will hide my real ip ????

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    It will "hide" your website's IP address behind the proxy

  • @securityitcomapnyireland.6642
    @securityitcomapnyireland.66423 жыл бұрын

    it says bad gateway

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Please see if the solutions from this video help you kzread.info/dash/bejne/mo2K1MuBkpeZp7g.html

Келесі