我在Debian 9上有一个新配置的Nginx设置的问题。我的网站使用https加载得很好,但是当我使用http访问它时,我得到了一个404 Not Found。 我尝试删除ssl证书,它工作,但我需要的位置/webex/接收在https和/ping和/mailgun在http。请参阅我编辑过的向下的服务器模块: server {
listen 80;
listen 443 ssl;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
location /ping
我对nginx很陌生,我正在尝试让我的second.domain.com显示first.domain.com/dir的内容(运行在本地主机的端口3000上)。
# this one works fine
server {
listen 80;
server_name first.domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgra
我在DigitalOcean的Ubuntu机器上创建了两个node.js实例。两者都使用不同的端口监听localhost。然后通过curl http:\localhost:${port}进行测试。两者都起作用了。
然后我将它们添加到/etc/nginx/site-available/default
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#t
server {
listen 8080; # http
# Forward requests to our node app at port 8082
#
location /mui {
# Remove the '/mui' portion of the path (and any extraneous trailing slash)
rewrite ^/mui/?(.*)$ /$1; break;
proxy_pass http://localhost:8082;
我用NGINX在我的vps上托管了一个网站,我的后端(在Node.js中)位于'/root/backend/MyApp‘目录中。我的前端服务(在React.js中)来自'/var/www/app/client‘,其中包含我的构建文件,包括index.html。我通过'/api/upload/profileimage‘端点存储用户的配置文件图像,然后使用'Multer’将图像上传到‘/root/后端/MyApp/上载/profileimage’目录中。如何配置nginx,以便我可以通过前端的url提供这些上传的图像?现在,我的服务器配置看起来如下:
server