0
우분투에서 nginx 및 uwsgi를 사용하여 세 개의 웹 응용 프로그램을 실행하려고합니다. 다음 nginx 구성으로 두 개의 응용 프로그램을 실행할 수 있었지만 세 번째 응용 프로그램을 실행하지 못했습니다. 실행 방법을 알려주세요.nginx에서 두 개 이상의 웹 응용 프로그램 실행하기
최초의 nginx 구성 : 문제없이 air-quality.conf
server {
listen 80;
real_ip_header X-Forwarded-For;
set_real_ip_from 127.0.0.1;
server_name localhost;
location/{
include uwsgi_params;
uwsgi_pass unix:/var/www/html/air-quality/socket.sock;
uwsgi_modifier1 30;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html{
root /usr/share/nginx.html;
}
}
, 위의 구성 밖으로 일 및 210.123.33.247:80/airData
에 출력을 보여 주었다. 두 번째 nginx 구성은 items-rest.conf
입니다. 그것은 :
또한 210.123.33.247:81/items
에 대한 출력을 나타냅니다. 하지만 세 번째는 작동하지 않았습니다. 구성 파일은 다음과 같습니다
server {
list en 8090;
real_ip_header X-Forwarded-For;
set_real_ip_from 127.0.0.1;
server_name localhost;
location {
include uwsgi_params;
uwsgi_pass unix:/var/www/html/display_air/socket.sock;
uwsgi_modifier1 30;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html{
root /usr/share/nginx.html;
}
}
세 번째 응용 프로그램을 실행하기 위해, 나는
sudo systemctl reload nginx
및
sudo systemctl restart nginx
을 시도했다. 그런 다음 말하는 오류를 발생
의 nginx : /etc/nginx/sites-enabled/display-air.conf:7
에서 "위치"지시문에 인수 무효 수를 [emerg가] 무엇 나 잘못 했니? 누구든지 나를 도와주세요.
어떤 바보 같은 실수 하는가 여기
슬래시를 놓치고있어. 너는 위대하다! 너는 나에게 많은 고통을 덜어 준다. 고마워, 니스. –
도움 덕분에 세 번째 앱을 실행할 수있었습니다. 그러나 웹 (210.123.33.247:8090)에서 로그인 할 때 내부 서버 오류가 발생했습니다. 왜 그런 일이 일어날 지 짐작할 수 있습니까? nginx 나 uwsgi를 통하지 않고 독립적으로 앱을 실행했을 때 제대로 작동합니다. 즉, 프로그램에 오류가 없다는 의미입니다. 맞습니까? 그 밖의 무엇이 문제 일 수 있습니까? –