Homestead-Vue Webpack服务器的Nginx 502错误

问题描述 投票:0回答:1

我正在本地主机(8080)上的Vue应用程序(我由npm run serve在本地运行)旁边本地使用Homestead(标记:v10.3.1)(用于Symfony 4.4 API开发),该主机使用Homestead上的那些Symfony API。我注意到,当我打开Vue服务器(准确地说是Webpack服务器)时,Vagrant机器在一段时间后会返回502错误状态代码(来自vagrant nginx)。

我曾尝试将默认的webpack服务器端口更改为8082,但这无济于事。问题仍然存在。

[当我禁用webpack服务器(对于Vue)并执行无用的重新加载--provision-Nginx恢复运行时。

我已经在Laravel的官方松弛上提出了这个问题的请求,但是我没有收到任何关于此问题的请求。

域的nginx错误日志:

2020/03/12 11:31:04 [error] 1484#1484: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.10.1, server: app-admin.local.pl, request: "POST /api/login HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "app-admin.local.pl", referrer: "http://localhost:8080/"

我正在使用Ubuntu 18.04系统。

Homestead.yml:

---
ip: "192.168.10.10"
memory: 4096
cpus: 4
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Dev/kiratikadminconsole-apiplatform
      to: /home/vagrant/kiratikadminconsole-apiplatform

sites:
    - map: app-admin.local.pl
      to: /home/vagrant/kiratikadminconsole-apiplatform/public
      type: symfony4

databases:
    - router_db

features:
    - mariadb: false
    - ohmyzsh: false
    - webdriver: false

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

站点nginx配置文件:(内部游荡人员)

server {
    listen 80;
    listen 443 ssl http2;
    server_name app-admin.local.pl;
    root "/home/vagrant/kiratikadminconsole-apiplatform/public";

    index index.html index.htm index.php;

    charset utf-8;



    location / {
        try_files $uri $uri/ /index.php?$query_string;

    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/app-admin.local.pl-ssl-error.log error;

    sendfile off;

    # DEV
    location ~ ^/index\.php(/|$) {
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~ /\.ht {
        deny all;
    }



    ssl_certificate     /etc/nginx/ssl/app-admin.local.pl.crt;
    ssl_certificate_key /etc/nginx/ssl/app-admin.local.pl.key;
}

有人在这里注意到相同的问题或类似的问题,或者有人可以帮助我解决这个问题吗?

如果您需要更多信息,我会提供。

nginx webpack vagrant webpack-dev-server homestead
1个回答
0
投票

我看到没有人遇到相同的问题,或者不是直接与Homestead连接。

© www.soinside.com 2019 - 2024. All rights reserved.