Надеюсь, это работает для вас, я провел всю ночь, пытаясь выяснить это, лол. Таким образом, это 5 утра, и я даже не уверен, что я говорю по-английски больше.

ытался настроить локальный проект Laravel. Поэтому я решил использовать бродячую коробку Homestead. После того, как я установил все это, как вэтот урок Я с нетерпением ждал, чтобы увидеть результат в браузере:

Первым дисплеем была ошибка nginx 502 Bad Gateway. Поэтому я попытался обновить это, и после этого была показана начальная страница Laravel по умолчанию. Затем я сделал несколько маршрутов и ссылок на некоторые подстраницы моего сайта, и каждый раз, когда я меняю свою страницу (через ссылку или вводя запрос get), я получаю «502 Bad Gateway», который исчезает после обновления сайта.

Я пытался:

изменить версию php (как здесь)увеличить буфер (как здесь)полностью переустановил мой бродяга и VirtualBoxиспользовать другой браузериспользуйте функциональную коробку моего коллеги

К сожалению, ничто не могло не показывать мне иногда «502 Bad Gateway». Но на ПК моего коллеги (также Windows 10) все так, как и следовало ожидать.

Файл журнала (/ var / log / nginx) сайта:

2019/01/23 20:23:53 [error] 2532#2532: *1 recv() failed (104: Connection 
reset by peer) while reading response header from upstream, client: 
192.168.10.1, server: eatthis.test, request: "GET / HTTP/1.1", upstream: 
"fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "eatthis.test"

2019/01/23 20:24:03 [error] 2532#2532: *1 recv() failed (104: Connection 
reset by peer) while reading response header from upstream, client: 
192.168.10.1, server: eatthis.test, request: "GET / HTTP/1.1", upstream: 
"fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "eatthis.test"

И /etc/nginx/sites-enabled/eatthis.test:

server {
listen 80;
listen 443 ssl http2;
server_name .eatthis.test;
root "/home/vagrant/code/Laravel/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/eatthis.test-error.log error;

sendfile off;

client_max_body_size 100m;

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


    fastcgi_intercept_errors off;
    fastcgi_buffer_size 16k;
    fastcgi_buffers 4 16k;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
}

location ~ /\.ht {
    deny all;
}

ssl_certificate     /etc/nginx/ssl/eatthis.test.crt;
ssl_certificate_key /etc/nginx/ssl/eatthis.test.key;
}

Моя усадьба.yaml:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: c:/Users/XXXX/.ssh/id_rsa.pub

keys:
- c:/Users/XXXX/.ssh/id_rsa

folders:
- map: c:/www/code
  to: /home/vagrant/code

sites:
- map: eatthis.test
  to: /home/vagrant/code/Laravel/public

databases:
- homestead

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

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# zray:
#  If you've already freely registered Z-Ray, you can place the token here.
#     - email: [email protected]
#       token: foo
#  Don't forget to ensure that you have 'zray: "true"' for your site.

И мои хозяева:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#       127.0.0.1       localhost
#       ::1             localhost
192.168.10.10 eatthis.test

Я думаю, что есть проблема на моем ПК или на моем vagrant, но я не знаю, что это может быть, потому что файлы загружаются после обновления.

Я надеюсь, что кто-нибудь может помочь мне с этой проблемой. Это освежает все время так раздражает.

Ответы на вопрос(2)

Ваш ответ на вопрос