Deploying strapi on a server like digital ocean

System Information
  • 3.3.3:
  • ubuntu 20 server:
  • mongodb: :

hi im deploying a fullstack app and i want the strapi cms to be accessible from the browser in something like /admin or /server
i added this

location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

in my nginx and set the location to my frontend and i tried to add

location /admin {
        proxy_pass http://localhost:1337;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

but it didnt work
can someone tell me how to make this happen ?

1 Like

I was able to deploy on digital ocean using the sub domain approach from Nginx Docs

Currently, I am running Strapi and a NextJS frontend on the same Droplet.
Strapi is at api.domain.com and the frontend at domain.com.

It looks like you are trying for the sub folder approach. Not sure of all the differences between this and the approach I used.

If you are still looking for a solution I can post my sites-available and other details. Its just a lot of stuff and I don’t want to waste time if you already have this figured out.

3 Likes

ty a lot my friend . i will read the docs you send if i couldnt find out ill ask for your help again to post it

1 Like