GVKun编程网logo

odoo reverse proxy nginx conf

25

如果您对odooreverseproxynginxconf感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于odooreverseproxynginxconf的详细内容,并且为

如果您对odoo reverse proxy nginx conf感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于odoo reverse proxy nginx conf的详细内容,并且为您提供关于apache mod_proxy,为跨域Ajax调用configurationProxyPass&ProxyPassReverse、apache mod_proxy,为跨域ajax调用配置ProxyPass和ProxyPassReverse、CentOS / Redhat: Install nginx As Reverse Proxy...、Compare with Haproxy and Nginx_tcp_proxy_module的有价值信息。

本文目录一览:

odoo reverse proxy nginx conf

odoo reverse proxy nginx conf

1.
You start the server with --workers > 0 (depending on your hardware), so you have that many threads on port 8069. You will also have a couple of cron threads on 8069 (configurable with --max-cron-threads) and one gevent thread on port 8072 (configurable with --longpolling-port).

You have to setup a reverse proxy (apache2 or nginx will do the job), and map your 8069 port to the external 80.

Here is the important part: you also have to reverse proxy your 8072 port to the external 80, but only for location /longpolling (in nginx this is done with a second location).

That way you have your users using the workers normally and the gevent thread only for getting the bus messages.

I will post soon a complete installation and configuration guide for v8.0 with all the details usually missing in available guides.

  

2.
server {
    listen  80;
    server_name  localhost;
    location / {
        proxy_pass http://0.0.0.0:8088;
        proxy_redirect    off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
    location /longpolling/ {  
        proxy_pass        http://localhost:8077/longpolling/;  
        proxy_redirect    off;  
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }  
}

  

apache mod_proxy,为跨域Ajax调用configurationProxyPass&ProxyPassReverse

apache mod_proxy,为跨域Ajax调用configurationProxyPass&ProxyPassReverse

我正在创build一个html5 – JavaScript应用程序(用于移动设备,使用PhoneGap)。 我必须与REST服务进行交互。

该服务现在运行在"http://localhost:8080/backend/mvc/"

我正在开发我的应用程序在一个wamp服务器(apache2)( http://localhost/stage/ )我正在使用Chrome浏览器。

在执行ajax调用时,浏览器响应: XMLHttpRequest cannot load http://localhost:8080/backend/mvc/event. Origin http://localhost is not allowed by Access-Control-Allow-Origin. XMLHttpRequest cannot load http://localhost:8080/backend/mvc/event. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

飞行前OPTIONS请求故障转移HTTPS

Nginx和CORS问题

Apache和Nodejs跨域ajax问题

同一域(本地主机)上的XHR跨域错误

访问控制允许起源不允许起源 – 如何使用一个非常简单的networking堆栈和guice启用CORS

所以我find几种方法来规避这个跨域的Ajax调用问题:

1)启动chrome chrome.exe --disable-web-security =>没有区别

2)使用mod_proxyconfigurationApache来redirectstream量。

我在httpd.conf中启用了:

proxy_module proxy_connect_module proxy_http_module

我把一个.htaccess文件放在www的根目录下,内容如下:

# start mod_rewrite RewriteEngine On ProxyRequests off <Proxy> Order deny,allow Allow from all </Proxy> ProxyPass /EMBackend/ http://localhost:8080/backend/mvc/ ProxyPassReverse /EMBackend/ http://localhost:8080/backend/mvc/ RewriteRule ^/EMBackend/(.*)$ /backend/mvc/$1 [R]

我重新启动所有服务(Apache,PHP,..)

导致错误500

apache错误日志: [Tue Oct 18 14:30:11 2011] [alert] [client 127.0.0.1] C:/wamp/www/.htaccess: ProxyRequests not allowed here

任何线索如何解决这个问题?

在Apache中使用Access-Control-Allow-Origin标头处理多个域

设置Nginx允许跨域请求子域

绕过“选项请求”的authentication(所有的头都在响应中发送)

跨域jQuery AJAXfile upload

跨域分块上传使用CORS

我发现一个工作解决方案:

启用:

Loadmodulee proxy_module modules/mod_proxy.so Loadmodulee proxy_http_module modules/mod_proxy_http.so

把它放在你配置的主要部分(或者如果使用Apache虚拟主机,则需要虚拟主机):

ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /EMBackend http://localhost:8080/backend/mvc ProxyPassReverse /EMBackend http://localhost:8080/backend/mvc <Location /EMBackend> Order allow,deny Allow from all </Location>

所以我想我不能把它放在.htaccess或我必须设置ProxyPreserveHost On 。 我将Include conf/extra/放在httpd.conf文件中,并创建了httpd-proxy.conf文件,并将其放在上面的脚本中。 重新启动Apache,它的工作!

启用代理模块后,您可以简单地在httpd.conf中添加给定的行。

ProxyPreserveHost On ProxyPass /EMBackend http://localhost:8080/backend/mvc ProxyPassReverse /EMBackend http://localhost:8080/backend/mvc

只需重新启动服务器,你就完成了。

在非常现代的Apache中,通过以下方式打开代理:

a2enmod proxy; a2enmod proxy_http

apache mod_proxy,为跨域ajax调用配置ProxyPass和ProxyPassReverse

apache mod_proxy,为跨域ajax调用配置ProxyPass和ProxyPassReverse

我正在创建一个html5-JavaScript应用(用于移动设备,使用PhoneGap)。我必须与REST服务进行交互。

该服务现在正在运行 "http://localhost:8080/backend/mvc/"

我正在wamp服务器(apache2)(http://localhost/stage/)上开发应用程序,正在使用Chrome浏览器。

当执行ajax调用时,浏览器响应: XMLHttpRequest cannot loadhttp://localhost:8080/backend/mvc/event. Origin http://localhost is notallowed by Access-Control-Allow-Origin.

因此,我找到了几种方法来解决此跨域Ajax调用问题:

1)起始chrome chrome.exe --disable-web-security =>没有区别

2)使用mod_proxy配置apache以重定向流量。

我在httpd.conf中启用了:

proxy_moduleproxy_connect_moduleproxy_http_module

.htaccess在www根目录下放置了一个文件,内容如下:

# start mod_rewriteRewriteEngine OnProxyRequests off<Proxy>    Order deny,allow    Allow from all</Proxy>ProxyPass /EMBackend/ http://localhost:8080/backend/mvc/ProxyPassReverse /EMBackend/ http://localhost:8080/backend/mvc/RewriteRule ^/EMBackend/(.*)$ /backend/mvc/$1 [R]

我重新启动了所有服务(apache,php等)。

导致错误500

apache错误日志: [Tue Oct 18 14:30:11 2011] [alert] [client 127.0.0.1]C:/wamp/www/.htaccess: ProxyRequests not allowed here

关于如何解决这个问题的任何线索?

答案1

小编典典

我找到了一个可行的解决方案:

启用:

LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_http_module modules/mod_proxy_http.so

将其放入配置的主要部分(或所需的虚拟主机,如果使用Apache虚拟主机):

ProxyRequests OffProxyPreserveHost On<Proxy *>    Order deny,allow    Allow from all</Proxy>ProxyPass /EMBackend http://localhost:8080/backend/mvcProxyPassReverse /EMBackend http://localhost:8080/backend/mvc<Location /EMBackend>    Order allow,deny    Allow from all</Location>

所以我想我不能把它放进去,.htaccess否则我必须摆放它ProxyPreserveHost On。我把Includeconf/extra/httpd.conf文件和创建的httpd-proxy.conf文件,并把上面的脚本在里面。重新启动了Apache,它正在工作!

CentOS / Redhat: Install nginx As Reverse Proxy...

CentOS / Redhat: Install nginx As Reverse Proxy...

CentOS / Redhat Linux: Install Keepalived To Provide IP Failover For Web Cluster


http://www.cyberciti.biz/faq/rhel-centos-fedora-keepalived-lvs-cluster-configuration/

Compare with Haproxy and Nginx_tcp_proxy_module

Compare with Haproxy and Nginx_tcp_proxy_module

nginx-0.7.65的配置:
 worker_processes  4;
tcp {
    upstream test{
        server 172.19.0.129;
        server 172.19.0.130;
        server 172.19.0.131;
        server 172.19.0.132;
        server 172.19.0.133;
        server 172.19.0.134;
        server 172.19.0.135;
        server 172.19.0.136;
        server 172.19.0.137;
        server 172.19.0.138;
        server 172.19.0.139;
        check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_http_send "GET / HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
    }

    server {
        listen 1982;
        proxy_pass test;
    }
}
haproxy-1.4.1的配置:
global
    log 127.0.0.1 daemon
    user yaoweibin
    nbproc 4

defaults
    backlog 2048
    balance roundrobin
    log global
    mode tcp
    retries 3
    contimeout 6s
    clitimeout 600s
    srvtimeout 600s

listen  test 0.0.0.0:8080
    server test-1 172.19.0.129:80 check inter 3s rise 2 fall 5 weight 10
    server test-2 172.19.0.130:80 check inter 3s rise 2 fall 5 weight 10
    server test-3 172.19.0.131:80 check inter 3s rise 2 fall 5 weight 10
    server test-4 172.19.0.132:80 check inter 3s rise 2 fall 5 weight 10
    server test-5 172.19.0.133:80 check inter 3s rise 2 fall 5 weight 10
    server test-6 172.19.0.134:80 check inter 3s rise 2 fall 5 weight 10
    server test-7 172.19.0.135:80 check inter 3s rise 2 fall 5 weight 10
    server test-8 172.19.0.136:80 check inter 3s rise 2 fall 5 weight 10
    server test-9 172.19.0.137:80 check inter 3s rise 2 fall 5 weight 10
    server test-10 172.19.0.138:80 check inter 3s rise 2 fall 5 weight 10
    server test-11 172.19.0.139:80 check inter 3s rise 2 fall 5 weight 10

 我的测试机器是一台四核的linux机器,请求获取的是203个字节的网页,后端有11台web服务器。由于在同一台服务器上用ab,当测试并发数大的时候,ab本身的CPU资源消耗有一定的影响。下面是测试结果:
ab是keepalive的情况
Compare with Haproxy and Nginx_tcp_proxy_module - 120斤的大青蛙 - 老和山小和尚
ab是nokeepalive的情况
Compare with Haproxy and Nginx_tcp_proxy_module - 120斤的大青蛙 - 老和山小和尚

结论:
我自己测试的结果是Nginx_tcp_proxy_module比Haproxy性能是要好一些的,但是由于测试的局限和偶然性,不排除在某些情况下有差异。比如在大文件的传输时,两者差异比较小,都可以轻易把千兆的网卡跑满,有机会我在把这部分测试补上。

ps: 在测试的时候把后端apache都跑挂了,不敢测了。

今天关于odoo reverse proxy nginx conf的讲解已经结束,谢谢您的阅读,如果想了解更多关于apache mod_proxy,为跨域Ajax调用configurationProxyPass&ProxyPassReverse、apache mod_proxy,为跨域ajax调用配置ProxyPass和ProxyPassReverse、CentOS / Redhat: Install nginx As Reverse Proxy...、Compare with Haproxy and Nginx_tcp_proxy_module的相关知识,请在本站搜索。

本文标签: