• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

nginx作为odoo的反向服务器配置

php 搞代码 4年前 (2022-01-22) 18次浏览 已收录 0个评论

这篇文章主要介绍了关于nginx作为odoo的反向服务器配置,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

nginx的安装略。

使用web服务器nginx作为odoo的反向代理服务器有以下几个优点:

1.缓存网页的静态内容,加快网页的加载速度。

2.利用nginx做数据分发,在分布式部署情况下能突破服务器的性能限制。

3.如果一台服务器有多个web服务(比如同时存在apache、odoo)都需要共用一个80端口,可以利用nginx作为反向代理服务器根据用户访问的域名进行数据分发。

修改nginx.conf的配置文件。

如下

#user  nobody;worker_processes  1;#error_log  logs/error.log;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '    #                  '$status $body_bytes_sent "$http_referer" '    #                  '"$http_user_agent" "$http_x_forwarded_for"';    access_log  logs/access.log  main;    sendfile        on;    #tcp_nopush     on;    #keepalive_timeout  0;    keepalive_timeout  65;        gzip  on;  #开启gzip,加快oe首页的加载速度。    server {        listen       80;   #监听80端口        server_name  59.110.222.158;  #        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            proxy_pass http://59.110.222.158:8069;    #反向代理服务器的ip:端口            proxy_set_header X-Real-Ip $remote_addr;            proxy_set_header X-Forwarded-For $remote_addr;        }        #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, <p>4本文¥来源gao!%daima.com搞$代*!码$网9</p><pre>搞代gaodaima码

if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #}}

效果:

相关推荐:

关于think PHP部署nginx 配置

nginx 配置 php遇到的问题解决

以上就是nginx作为odoo的反向服务器配置的详细内容,更多请关注搞代码gaodaima其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:nginx作为odoo的反向服务器配置

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址