How to deploy React application on Nginx?

Поділитися
Вставка
  • Опубліковано 12 гру 2024

КОМЕНТАРІ • 27

  • @prithwirajdutta3827
    @prithwirajdutta3827 5 років тому +2

    Very clear way of explaining thanks

  • @radar_raps
    @radar_raps 8 місяців тому

    I'm having some issues. I created a project which uses a client (react app) and a server (docker container running a flask server). I am trying to first setup the frontend because I also have a nextjs project running on the same server. I have the nextjs project to port 3000, and it is accessible there, but I followed the steps in the video for my react app and set the port to 5000 but its not working as intended.

  • @nippuntyagi3058
    @nippuntyagi3058 5 років тому +5

    Please show how to do with ec2

  • @devshah4030
    @devshah4030 3 роки тому +2

    great tutorial though the issue is with routes within the app i.e. this setup perfectly serves the landing page though if you visit any specific page by manually typing the URI, Nginx will show page not found 404. So, in your above example, if you try to say view any property details by clicking on the any link (house image), it will render house details though if you try to reload the page, you will get 404 as Nginx won't be able to find that html in your specified root. I'm still not sure how to get around this issue.

    • @devshah4030
      @devshah4030 3 роки тому

      ok, found the answer here in SO post stackoverflow.com/questions/27928372/react-router-urls-dont-work-when-refreshing-or-writing-manually?page=1&tab=votes#tab-top
      Add this to your nginx.conf or ssl.conf (depending upon how your site is hosted). It fixes all these client side routing issues.
      location / {
      if (!-e $request_filename){
      rewrite ^(.*)$ /index.html break;
      }
      }

    • @garimamody7535
      @garimamody7535 2 роки тому

      Hey, did you get solution for it?

    • @devshah4030
      @devshah4030 2 роки тому

      @@garimamody7535 see my above reply with SO thread for the solution.

    • @vanhungnguyen7543
      @vanhungnguyen7543 2 роки тому

      I have the same problem, can you guide me to fix it?

    • @devshah4030
      @devshah4030 2 роки тому

      @@vanhungnguyen7543 did you follow the Stackoverflow thread which I've posted above?

  • @rakeshpk4991
    @rakeshpk4991 3 роки тому +1

    Good Description. Thanks.

  • @cleverengineers
    @cleverengineers 3 роки тому

    I need help. I have a React JS site...it was working fine...lastly I have changed my root password of my DigitalOcean Droplet. After changing the root password its showing an Error Message "502 Bad Getway" . Please help me how to resolve it?

  • @monireol
    @monireol 3 роки тому +1

    1:08
    You providing a description in the link,
    Or
    You providing a link in the description

  • @renansabat2081
    @renansabat2081 3 роки тому

    4:06 where is this file in ubuntu?

    • @adivmt
      @adivmt 2 роки тому

      cd /etc/nginx

  • @007bouba
    @007bouba 3 роки тому

    thanks man keep it up !

  • @ashishnagar7380
    @ashishnagar7380 4 роки тому +2

    Hey 👋 , This is what I was looking for .. well explained with example ... can we do the same at EC2 instance ? .. please reply .. 🙏🙏🙏

    • @ashishnagar7380
      @ashishnagar7380 4 роки тому

      Bhai reply kr de .... like krke kya hoga ?

  • @sureshhanda4643
    @sureshhanda4643 4 роки тому

    Nicely explained

  • @bhumikabajpai3229
    @bhumikabajpai3229 5 років тому +1

    Thanx for the video

  • @bhumikabajpai3229
    @bhumikabajpai3229 5 років тому

    Thanks for the explanation

  • @priyanshsamuel7620
    @priyanshsamuel7620 5 років тому +1

    This is helpful

  • @vinod-ij7dz
    @vinod-ij7dz 5 років тому

    Where is the links ?

    • @DeveloperFunnel
      @DeveloperFunnel  5 років тому

      github.com/Aakashdeveloper/EDU_May_React_Eveng/tree/master/redux3