Мне нужно указать номер порта из url. Я запускаю экземпляр odoo с использованием --db-filter = '^% d @', mydomain.com:8069 работает отлично, но mydomain.com не получает страницу. Я установил nginx и отредактировал /etc/nginx/nginx.conf
, как показано ниже.Скрыть номер порта в URL-адресе?
/etc/nginx/nginx.conf
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
# anything written in /opt/nginx/conf/mime.types is interpreted as if written inside the http { } block
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;
keepalive_timeout 65;
server {
# You would want to make a separate file with its own server block for each virtual domain
# on your server and then include them.
listen 8069;
listen 192.168.1.111:8080;
listen 192.168.1.111;
#tells Nginx the hostname and the TCP port where it should listen for HTTP connections.
# listen 80; is equivalent to listen *:80;
#server_name localhost;
server_name mydomain.com;
server_name www.mydomain.com;
# lets you doname-based virtual hosting
#charset koi8-r;
#access_log logs/host.access.log main;
location/{
#The location setting lets you configure how nginx responds to requests for resources within the server.
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;
}
}
}
Как я могу это сделать? предложите любые решения.
Вам необходимо сделать приложение доступным из порта по умолчанию. Порт 80 для HTTP и порт 443 с HTTPS. –
Может ли expalin как я могу это сделать .. какой файл я редактирую? – KbiR
Вы хотите, чтобы apache/nginx получал порт 80 и перенаправлялся на порт 8069. Если вы посмотрите на запущенный odoo с обратным прокси (GOOGLE), вы его найдете. Вот обсуждение по этому вопросу. Здесь очень много. https://www.odoo.com/forum/help-1/question/nginx-reverse-proxy-on-80-443-32052 –