使用nginx配置訪問wgcloud的方法
更新時間:2021年06月26日 17:01:34 作者:tianshiyeben
這篇文章主要介紹了使用nginx配置訪問wgcloud的方法,在這里大家需要記得agent的配置文件項serverUrl的80端口也要寫上,需要的朋友可以參考下
nginx配置如下:
如http://172.17.188.27/wgcloud
server {
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.html 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 the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
記得agent的配置文件項serverUrl的80端口也要寫上,如下
#wgcloud-server端訪問地址,端口一定要寫,即使是80也要寫哈 serverUrl=http://172.17.188.27:80
補充:nginx配置訪問wgcloud,提高訪問速度
upstream wgcloudServer {
server 172.17.188.27:9999 weight=10;
ip_hash;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://wgcloudServer;
#root html;
#index index.html 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;
}
到此這篇關(guān)于使用nginx配置訪問wgcloud的文章就介紹到這了,更多相關(guān)nginx配置wgcloud內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
記一次nginx配置不當(dāng)引發(fā)的499與failover 機制失效問題
近期在非高峰期也存在499超過告警閾值的偶發(fā)情況,多的時候一天幾次,少的時候則幾天一次,持續(xù)一般也就數(shù)分鐘,經(jīng)過和小伙伴的共同探究,最后發(fā)現(xiàn)之前對于499是客戶端主動斷開因而和服務(wù)端關(guān)系不大的想當(dāng)然認(rèn)知是錯誤的,這里記錄一下2023-05-05
nginx?反向代理負(fù)載均衡策略配置SSL訪問匹配規(guī)則優(yōu)先級
本文主要包含1.Nginx配置文件詳解2.Nginx實現(xiàn)負(fù)載均衡3.Nginx前端項目部署4.Nginx配置SSL訪問5.nginx匹配規(guī)則說明以及匹配的優(yōu)先級的內(nèi)容詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-06-06
關(guān)于Nginx中虛擬主機的一些冷門知識小結(jié)
這篇文章主要給大家介紹了關(guān)于Nginx中虛擬主機的一些冷門知識,文中通過圖文以及實例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2022-03-03

