콘텐츠로 건너뛰기
Odoo 메뉴
  • 로그인
  • 무료 체험하기
  • 앱
    재무 관리
    • 회계
    • 청구서 관리
    • 비용 관리
    • 스프레드시트 (BI)
    • 문서
    • 전자 서명
    판매
    • CRM
    • 판매
    • POS 스토어
    • POS 레스토랑
    • 구독
    • 렌탈
    웹사이트
    • 웹사이트 빌더
    • 이커머스
    • 블로그
    • 포럼
    • 실시간 채팅
    • 온라인 학습 관리
    공급망
    • 재고 관리
    • 제조 관리
    • 제품 수명주기 관리 (PLM)
    • 매입
    • 유지관리
    • 품질
    인적자원 관리
    • 직원
    • 채용
    • 휴가 관리
    • 인사 평가
    • 인재 추천
    • 차량 관리
    마케팅
    • 소셜 마케팅
    • 이메일 마케팅
    • SMS 마케팅
    • 행사
    • 마케팅 자동화
    • 설문 조사
    서비스
    • 프로젝트
    • 작업 기록
    • 현장 서비스
    • 헬프데스크
    • 일정 관리
    • 일정 예약
    생산성
    • 메일 및 채팅
    • 전자 결재
    • IoT
    • VoIP
    • 지식 센터
    • WhatsApp
    타사 앱 Odoo 스튜디오 Odoo 클라우드 플랫폼
  • 인더스트리
    리테일
    • 서점
    • 의류 매장
    • 가구점
    • 식료품점
    • 철물점
    • 장난감 가게
    식음료 & 숙박업
    • 바 & 펍
    • 레스토랑
    • 패스트푸드
    • 게스트 하우스
    • 음료 유통업체
    • 호텔
    부동산
    • 부동산 중개업체
    • 건축 회사
    • 건설
    • 부동산 관리
    • 가드닝
    • 부동산 소유자 협회
    컨설팅
    • 회계 법인
    • Odoo 파트너
    • 마케팅 대행사
    • 법률 사무소
    • 인재 영입
    • 감사 및 인증
    제조 관리
    • 텍스타일
    • 메탈
    • 가구
    • 푸드
    • 양조장
    • 기업용 선물
    건강 & 피트니스
    • 스포츠 클럽
    • 안경점
    • 피트니스 센터
    • 웰니스 전문가
    • 약국
    • 미용실
    사업
    • 핸디맨
    • IT 하드웨어 및 지원 서비스
    • 태양 에너지 시스템
    • 제화업체
    • 클리닝 서비스
    • HVAC 서비스
    기타
    • 비영리 단체
    • 환경 에이전시
    • 광고판 임대
    • 사진
    • 자전거 임대
    • 소프트웨어 리셀러
    전체 인더스트리 찾아보기
  • 커뮤니티
    학습
    • 튜토리얼
    • 문서
    • 인증
    • 훈련
    • 블로그
    • 팟캐스트
    교육 역량 강화
    • 교육 프로그램
    • Scale-Up! 경영관리 게임
    • Odoo에 방문해보세요
    소프트웨어 신청
    • 다운로드
    • 버전 살펴보기
    • 릴리즈 내역
    협업
    • Github
    • 포럼
    • 행사
    • 번역
    • 파트너 등록
    • 파트너 대상 서비스
    • 회계 법인 정보 등록
    서비스 신청
    • 파트너 검색
    • 회계사 검색
    • 전문 상담 예약
    • 구현 서비스
    • 고객 정보
    • 고객 지원
    • 업그레이드
    Github 유튜브 트위터 링크드인 인스타그램 페이스북 스포티파이
    +1 (650) 691-3277
    데모 예약하기
  • 요금제
  • 고객 지원

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • 회계
  • 재고 관리
  • PoS
  • 프로젝트
  • MRP
All apps
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
모든 게시물 사용자 배지
태그 (모두 보기)
odoo accounting v14 pos v15
게시판 정보
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
모든 게시물 사용자 배지
태그 (모두 보기)
odoo accounting v14 pos v15
게시판 정보
도움말

reverse proxy to subdirectory <host.domain.tld>/external/erp

구독

이 게시물에 활동이 있으면 알림 받기

신고된 질문입니다
proxyapache2subdirectoryreverse
5 답글
57072 화면
아바타
Stefan Reichel

Hi,

I am currently building and customizing a v7 instance for a client. Their server hosts various applications, e.g. mail, webdav and OpenERP. The reverse proxy (Apache2) is working in general. When we enter https:/<url.domain.tld>/external/erp hit the OpenERP server at localhost:8069 which responds with 301 but redirects to the wrong address https:/<url.domain.tld>/?db=liveDB

I have set proxy_mode = True in openerp-server.conf How can I get OpenERP to honour the invoked sub-directory "/external/erp" and redirect to https:/<url.domain.tld>/external/erp/?db=liveDB Invoking https:/<url.domain.tld>/external/erp/?db=liveDB leave the browser (Firefox) blank. The page source shows the header by the body is empty <body></body> Firebug in Firefox showed that the JS function cannot be found which led to me spotting fixed references in the html-head to href="/web/..." which should be href="web/..." (no leading slash).

The environment is OpenERP 7, Ubuntu 10.04, Apache2

Cheers, Stefan

2
아바타
취소
Stefan Reichel
작성자

I assume that /web contains the static files so I used the static_http_url_prefix=/external/erp, static_http_enable = True and static_http_document_root = /usr/lib/pymodules/python2.6/openerp/addons/web but this did not seem to make any difference for the JS and CSS in the HTML head.

아바타
Med Said BARA
베스트 답변

Hi; Try to use NGINX.

try a google search for openerp 7 + nginx + apache

HERE:

If you need to proxy requests for a specific location to a specific resource, use a rewrite rule to capture the path to the resource and pass that along to the proxied server. For example, if you want all requests for http://example.com/ to be handed to a server running on 192.168.3.105 with a path of /teams/~example/, you would write the following location block:

File excerpt:/etc/nginx/sites-available/example.com

 location / {
   rewrite ^(.*)$ /teams/~example/$1 break;
   proxy_pass   http://192.168.3.105;
 }
0
아바타
취소
Stefan Reichel
작성자

Hi, I have found loads of instructions which apply to either v6.1 or to v7 but are to redirect from http to https and to avoid port 8069. But a subdirectory seems to be the rare odd one out. from my understanding nginx is more lightweight than apache but does not actually add any functionality, right? So what ever is possible to achieve in nginx should be possible to achieve with apache and vice versa.? Please correct me if I'm wrong. Cheers

Med Said BARA

Please, take a look at : http://www.wikivs.com/wiki/apache_vs_nginx http://blog.f3re.com/comparatif-nginx-vs-apache/ http://www.thegeekstuff.com/2013/11/nginx-vs-apache/

Med Said BARA

Why NGINX? http://nginx.com/

Med Said BARA

APACHE or NGINX OR https://www.digitalocean.com/community/articles/how-to-configure-nginx-as-a-front-end-proxy-for-apache

Stefan Reichel
작성자

understood and convinced. I'll get nginx underway. I have to get myself into the config syntax and get back about any success (or failure). Thanks so far.

Med Said BARA

The hardest is the config file (nginx.conf ). Good luck ..... waiting for a feedback

Med Said BARA

The hardest is the config file (/etc/nginx/nginx.conf). Good luck, waiting for feedback

Stefan Reichel
작성자

I have put nginx before apache and OpenERP's python. It does not work great and is a lot more administration than with apache2. Due to given circumstances we cannot just redirect /(.*) as suggested as we have other hosted applications too. So my question remained unanswered to a certain degree as I don't think that the "proxy" and the "static_http" parameters in the OpenERP config actually do work. In nginx I also had to redirect /web as this is another source that's referred to in the HTML code. Cheers, Stefan

Med Said BARA

Did you read my last answer ?

Stefan Reichel
작성자

yes, I did read your answer along with the link you provided. That was all very enlightening. I need to give this another shot. I had to revert back to apache as other bits broke during the transition to nginx. I managed to get Apache to rewrite the html responses using 'ProxyHTMLUrlMap' That does exactly what I was after (rewriting the src=.. and href=.. prepending "/intern/erp"). I assume that's exactly what your last comment is meant to achieve. The HTML and JS code is right, but the UI still doesn't load but leaves and empty/white page. When I reverse-proxy /web it works though.

Med Said BARA

Follow this ---> Proxying Content with mod_rewrite http://httpd.apache.org/docs/2.2/rewrite/proxy.html

아바타
Stefan Reichel
작성자 베스트 답변

I assume that the files served from /web/ are the static ones. Hence, I tried using the static_http_url_prefix=/external/erp, static_http_enable = True, and static_http_document_root = /usr/lib/pymodules/python2.6/openerp/addons/web This change did not have any impact.

Then I tried Apache2's RedirectMatch and RewriteRule directives but for some reason they did not kick in either.

Back to square one. no change and issue persists. Does anyone have come across this before?

Cheers, Stefan

0
아바타
취소
아바타
Stefan Reichel
작성자 베스트 답변

right. I have put nginx in place to do the proxy functionality which Apache2 did so far. however, the result is the same. Even though we can serve the static files through nginx in a static context but the assumption that any thing prefixed with "/web/" is satic failed us as /web/webclient seems to be a dynamic context i.e. cannot be found as file.

The question remains: We cannot redirect ^/.* as we have this already assigned to another application. Hence we would like to prefix the virtual path with "/internal/erp". However, this seems difficult if not impossible. We hoped that "static_http_url_prefix" would solve our issue, but that was not the case. openerp-server.conf

[options]
without_demo = False
unaccent = False
db_template = template1
db_password = noneofyourbusiness
xmlrpcs = True
xmlrpcs_interface =
syslog = False
logrotate = True
xmlrpcs_port = 8071
test_report_directory = False
list_db = True
timezone = False
xmlrpc_interface =
test_file = False
smtp_password = False
secure_pkey_file = server.pkey
xmlrpc_port = 8069
workers = 0
log_level = info
xmlrpc = True
admin_passwd = noneofyourbusiness
smtp_port = 25
smtp_server = localhost
static_http_url_prefix = /extern/erp
limit_request = 8192
test_commit = False
proxy_mode = True
demo = {}
dbfilter = .*
login_message = False
import_partial =
pidfile = False
db_maxconn = 64
osv_memory_count_limit = False
reportgz = False
osv_memory_age_limit = 1.0
netrpc_port = 8070
db_port = False
db_name = False
debug_mode = False
netrpc = False
limit_time_real = 120
limit_memory_hard = 805306368
logfile = /var/log/openerp/openerp-server.log
csv_internal_sep = ,
limit_time_cpu = 60
pg_path = None
limit_memory_soft = 671088640
static_http_enable = True
translate_modules = ['all']
smtp_ssl = False
server_wide_modules = None
netrpc_interface = 127.0.0.1
smtp_user = False
log_handler = ["[':INFO']"]
db_user = openerp
db_host = False
test_enable = False
max_cron_threads = 2
static_http_document_root = /usr/lib/pymodules/python2.6/openerp/addons/web
email_from = False
addons_path = /usr/lib/pymodules/python2.6/openerp/addons
secure_cert_file = server.cert

nginx configuration

server {
        listen   443 default;
        ssl     on;
        ssl_certificate /etc/ssl/certs/domain.com.crt;
        ssl_certificate_key /etc/ssl/private/domain.com.key;
        ssl_session_timeout  5m;
        ssl_protocols  SSLv2 SSLv3 TLSv1;
        ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
        ssl_prefer_server_ciphers   on;
        server_name  host.domain.tld;

        access_log  /var/log/nginx/webmail.domain.com.ssl_access.log;

        location ^~ /inter*/wiki/(data|conf|bin|inc) {
                deny all;
        }
        location /web {
                root /usr/share/pyshared/openerp/addons;
        }

        location /intern/erp {
                rewrite ^/intern/erp/(.*) /$1 break;
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:8069;
        }

#       location /internal/ {
#               alias   /var/www/;
#               index  index.html index.htm index.php;
#       }

        location /internal/ {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:8080;
        }

        location /intern/ {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:8080;
        }

        location /internal/erp {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:8069;
        }

        location /extern/erp {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:8069;
        }
        location /external/erp {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:8069;
        }

        location /extern {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:8080;
        }

        location ~ /\.ht {
                deny all;
        }

        # redirect to webmail/Zimbra
        location / {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:81;
        }
        location /zimbra/ {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:81;
        }
        location /service/ {
                proxy_set_header X-Real-IP  $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Host $host;
                proxy_pass hppt://127.0.0.1:81;
        }
0
아바타
취소
Stefan Reichel
작성자

thread help.openerp.com/question/6574/how-to-serve-http-static-files/ raises the same question but has not answer.

Med Said BARA

In case you are running two instances of openerp Just config one of your openerp (externel or internal) to run on an other port than 8069 (8169; 8869 ........) any other port not in use. And make change in nginx.conf to the port chosen.

Med Said BARA

In case you want to redirect a customer to a specific database, just append "/?db=databasename" to the URL.

Stefan Reichel
작성자

we have only one instance running on 8069. and both URLs i.e. internal and external currently respond to request but are being forwarded to the very same instance. That's okay.

Stefan Reichel
작성자

When we invoke https://fqdn/internal/erp the proxy works great and forwards the request to OpenERP. OpenERP sends a response back which redirects to the starndard DB at the absolute URL "/?db=DefaultDB" rather than the invoked relative path "/internal/erp/?db=DefaultDB".

Stefan Reichel
작성자

appending the DB to the invoked path "/internal/erp/?db=DefaultDB" returns a white page page with the HTML title "OpenERP"

Stefan Reichel
작성자

<html style="height: 100%"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>OpenERP</title> <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/> <link rel="stylesheet" href="/web/static/src/css/full.css" /> <link rel="stylesheet" href="/web/webclient/css?db=dreipuls"> <script type="text/javascript" src="/web/webclient/js?db=dreipuls"></script> ...

Stefan Reichel
작성자

that returned code indicates that the proxy works okay but the internal links in href=".." are wrong. Getting those changed to either be relative or have a static context prepended would solve the issue. But currently I have no idea how to get this accomplished. Any clues?

Med Said BARA

By ../external/erp , i think you mean access from the outside (external to lacal network ?). If so, have you checked the config of your router ?

Stefan Reichel
작성자

forget about the /external/erp URL. The router is fine. Let's focus on /internal/erp first. I can get the rest to work. Cheers.

Med Said BARA

If you need to proxy requests for a specific location to a specific resource, use a rewrite rule to capture the path to the resource and pass that along to the proxied server. For example, if you want all requests for http://example.com/ to be handed to a server running on 192.168.3.105 with a path of /teams/~example/, you would write the following location block:

File excerpt:/etc/nginx/sites-available/example.com

 location / {
   rewrite ^(.*)$ /teams/~example/$1 break;
   proxy_pass   <a href="http://192.168.3.105">http://192.168.3.105</a>;
 }
Med Said BARA

The link is here: https://library.linode.com/web-servers/nginx/configuration/front-end-proxy-and-software-load-balancing

아바타
istr
베스트 답변

This is a "known issue" since 5.1 marked as "won't fix": https://bugs.launchpad.net/openobject-client-web/+bug/384798 (sorry, need some obscure "karma" to post a direct link, so you have to copy+paste). The use case is common (SSL proxy and EV certificate or single domain policy), so using a subdomain ist not a solution. I cannot understand why nobody addresses this. C'mon, this is a bug. And it is over five years old.

 

0
아바타
취소
아바타
Valentin Lab
베스트 답변

Hum you might want to really try Virtual Hosting instead of using subdir. Here's why:

Somehow, all links produced by the application (openerp) should be relative (and it's not the case). When I speak of "all links", I mean the CSS links, the first Javascript source links, then all the RPC calls done also. And maybe more hiding here or there. So patching openerp is a long solution. Other solution are not really complete also: they involve rewriting URL in HTTP packets content on the fly. This can be done by your Proxy, but it doesn't work all the time (they must look in CSS also, and what if you build your request in javascript ?) ...

Additionaly, there are issues in Werkzeug itself preventing this to work as-is also. If you want more info: please refer to:

https://github.com/mitsuhiko/werkzeug/issues/540

Note that there's a quick fix for the werkzeug part.

So finaly, this is a no-go. Find a way to make a VirtualHost (aka http://odoo.example.com), and avoid subdir proxying (http://example.com/odoo) unless your app is very simple and won't evolve to much. So this is not for Odoo/OpenERP.

0
아바타
취소
토론이 재미있으신가요? 직접 참여해보세요!

지금 바로 가입하여 독점 서비스를 이용해보고 특별한 커뮤니티와 소통하세요!

가입
관련 게시물 답글 화면 활동
[8.0]Website Module Bad redirection behind apache proxy : slash missing 해결 완료
proxy apache2
아바타
1
3월 15
5790
Error in redirecting a module to the website
proxy apache2 odoo16
아바타
1
8월 24
1826
Apache X-Odoo-dbfilter not working Odoo 12
proxy apache2 v12
아바타
아바타
아바타
아바타
4
7월 20
5206
Multiple OpenERP instance with port redirection 해결 완료
proxy hosting apache2
아바타
1
3월 15
6734
Odoo 10 Can't restore Database with Database Manager behind Apache Proxy.
proxy apache2 databasebackup odoo10
아바타
아바타
아바타
3
7월 21
9214
커뮤니티
  • 튜토리얼
  • 문서
  • 포럼
오픈 소스
  • 다운로드
  • Github
  • Runbot
  • 번역
서비스
  • Odoo.sh 호스팅
  • 고객 지원
  • 업그레이드
  • 맞춤 개발
  • 학습
  • 회계사 검색
  • 파트너 검색
  • 파트너 등록
회사 소개
  • 회사 소개
  • 브랜드 자산
  • 상담 문의
  • 인재 채용
  • 행사
  • 팟캐스트
  • 블로그
  • 고객 사례
  • 법적고지 • 개인정보
  • 보안
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo는 CRM, 이커머스, 회계, 재고, POS, 프로젝트 관리 등 기업의 모든 요구 사항을 충족하도록 설계된 오픈 소스 기반의 통합 비즈니스 앱 제품군입니다.

Odoo의 간편한 UI와 완벽하게 통합된 기능을 직접 확인해 보세요.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now