C++ 无法在nginx+;中获取CGI错误日志;fastcgi+;c++;
我正在将服务器从Apache+mod_cgi迁移到nginx+fastcgiwrap,由于某些原因,应用程序cerr没有显示在nginx错误中 nginx设置:C++ 无法在nginx+;中获取CGI错误日志;fastcgi+;c++;,c++,nginx,cgi,fastcgi,C++,Nginx,Cgi,Fastcgi,我正在将服务器从Apache+mod_cgi迁移到nginx+fastcgiwrap,由于某些原因,应用程序cerr没有显示在nginx错误中 nginx设置: server { error_log /var/log/nginx/test-error.log; # ... location ~ \.cgi$ { # ... fastcgi_intercept_errors on; } } 错误日志权限: ~# ls -lA /va
server {
error_log /var/log/nginx/test-error.log;
# ...
location ~ \.cgi$ {
# ...
fastcgi_intercept_errors on;
}
}
错误日志权限:
~# ls -lA /var/log/nginx/test-error.log
-rwxrwxrwx 1 www-data www-data 0 Jun 17 21:27 /var/log/nginx/test-error.log
fastcgi“-f”标志:
应用程序本身:
#include <iostream>
int main( void ) {
std::cout << "Content-Type: text/html; charset=UTF-8\n\n";
std::cout << "Hello World.";
std::cerr << "Should appear on the nginx log..." << std::endl;
return 0;
}
#包括
内部主(空){
标准::cout
#include <iostream>
int main( void ) {
std::cout << "Content-Type: text/html; charset=UTF-8\n\n";
std::cout << "Hello World.";
std::cerr << "Should appear on the nginx log..." << std::endl;
return 0;
}