怎么用nginx访问外网页面的内容(教你如何使用nginx配置访问wgcloud)

wufei123 发布于 2023-10-20 阅读(709)

php简单入门

篇文章主要介绍了使用nginx配置访问wgcloud的方法,在这里大家需要记得agent的配置文件项serverUrl的80端口也要写上,需要的朋友可以参考下

nginx配置如下:如htt教程p://172.17.188.27/wgcloudserver { listen 80; server_name localhost; #charset koi8-r;

#access_log logs教程/host.access.log main; location / { proxy_pass http://172.17.188.27:9999;

#root html; #index index.ht教程ml index.htm; } #error_page 404 /404.html;

# redirect server error pages to the static page /50x.html教程 # error_page 500 502 503 504 /50x.html;

location = /50x.html { root html; } # proxy the PHP scripts 教程to Apache listening on 127.0.0.1:80

# #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass t教程he PHP scripts to FastCGI server listening on 127.0.0.1:9000

# #location ~ \.php$ { # root html; # fa教程stcgi_pass 127.0.0.1:9000;

# fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcg教程i_script_name;

# include fastcgi_params; #} # deny access to .htaccess files, if Apaches document roo教程t

# concurs with nginxs one # #location ~ /\.ht { # deny all; #} }

记得agent的配置文件项serverUrl的80端口也要写上,如下#教程wgcloud-server端访问地址,端口一定要写,即使是80也要写哈serverUrl=http://172.17.188.27:80

补充:nginx配置访问wgcloud,提高访问速度upstr教程eam wgcloudServer { server 172.17.188.27:9999 weight=10; ip_hash;

} server { listen 80; server_name l教程ocalhost; #charset koi8-r; #access_log logs/host.access.log main;

location / { proxy_pass http://wgcl教程oudServer; #root html; #index index.html index.htm;

} #error_page 404 /404.html; # redirect server er教程ror pages to the static page /50x.html

# error_page 500 502 503 504 /50x.html; location = /50x.html {教程 root html;

}到此这篇关于使用nginx配置访问wgcloud的文章就介绍到这了。本文地址:https://www.linuxprobe.com/nginx-wgcloud-linux.ht教程ml

亲爱的读者们,感谢您花时间阅读本文。如果您对本文有任何疑问或建议,请随时联系我。我非常乐意与您交流。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

大众 新闻92351