英文:
Deployment of Strapi to a DigitalOcean droplet with Nginx server
问题
我遇到了一个问题,无法访问部署在运行Ubuntu 18.04的DigitalOcean droplet上的Strapi应用程序。文档已经按照说明进行了操作,但似乎到此为止。
该应用程序明确地在服务器上使用pm2
运行。Nginx的服务器块已经按照指南成功设置。然而,最终目标是能够从该域名查看Strapi管理仪表板,而不仅仅是占位符HTML。
是否需要进一步配置以使该应用程序能够从该域名访问?
英文:
I'm having an issue being able to access a Strapi app deployed to a DigitalOcean droplet running Ubuntu 18.04. The docs have been followed but then they just sort of end.
The app is definitely running using pm2
on the server. The Nginx server block has been set up successfully per the guide it seems. However, the end goal is to be able to view the Strapi admin dashboard from that domain, not just the placeholder HTML.
Is there some further configuration required in order for for the app to be accessable from that domain?
答案1
得分: 0
Nginx服务器需要进一步配置。编辑位于 /etc/nginx/sites-available/your_domain
的文件。
location
对象默认应该包含 try_files $uri $uri/ =404;
。请将其替换为以下内容:
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;
英文:
The Nginx server requires further configuration. Edit the file located at /etc/nginx/sites-available/your_domain
.
The location
object should have try_files $uri $uri/ =404;
by default. Replace this with the following:
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;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论