% podman run -p 8822:8822 --name nginx -d nginx:alpine
Resolving "nginx" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)
Trying to pull docker.io/library/nginx:alpine...
Getting image source signatures
Copying blob sha256:76f8ad18306ed8a7757d73f845d89b3aee98b4774af2b7c5c9a288bcf097036c
Copying blob sha256:0be31969a6d1e1f2699d0fb5a48f1b4da62a3b2aefa8a9b0dfb548bc497bf321
Copying blob sha256:6e771e15690e2fabf2332d3a3b744495411d6e0b00b2aea64419b58b0066cf81
Copying blob sha256:83f1386059fa17276f4f0e676f45370a63667006c4d8e514298f71c6639328ea
Copying blob sha256:8ea77ffafa6ef989339c5c391fb30729e3f148240c0834f1db148158ab32f657
Copying blob sha256:9e170776f94c97f95260908e78676599218d0247c22929326f7072689b832bbb
Copying blob sha256:3c5c25f3816a63c8239c4a853ae22036406ffbd4f55b16e29e01f941f2dea356
Copying blob sha256:0a329c61f9e1dc20260b65b0ef67440ced65fbf671c1e93df0a9710fbb42d536
Copying config sha256:cedb667e1a7b4e6d843a4f74f1f2db0dac1c29b43978aa72dbae2193e3b8eea3
Writing manifest to image destination
aa331c3fdd940c53ae85b90ec874bd6bbf85aaaccf3e80474c8ad0b993a23cf6
%
リバース・プロキシを構成します。コンテナnginxに接続します。
% podman exec -it nginx sh
/ #
/etc/nginx/conf.d/default.confを以下の内容に置き換えます。
server { | |
listen 8822; | |
listen [::]:8822; | |
server_name localhost; | |
#access_log /var/log/nginx/host.access.log main; | |
# | |
# Redirect to Open WebUI | |
# Ref: https://github.com/open-webui/open-webui/discussions/1235 | |
# | |
location / { | |
proxy_pass http://host.containers.internal:3000; | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Accept-Encoding ""; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
# sub_filter '"/_app/' '"/openwebui/_app/'; | |
# sub_filter '"/themes/' '"/openwebui/themes/'; | |
# sub_filter_once off; | |
} | |
#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 /usr/share/nginx/html; | |
} | |
# | |
# redirect to Oracle APEX | |
# Ref | |
# https://blog.viscosityna.com/using-nginx-as-a-reverse-proxy-for-oracle-apex-and-ords | |
# https://medium.com/@ppytlak.dev/reverse-proxy-with-oracle-apex-free-tier-and-nginx-on-mikr-us-858c30d1961e | |
# https://jmjcloudblog.hashnode.dev/access-atp-apex-using-a-reverse-proxy | |
# https://content.dsp.co.uk/apex/apex-behind-a-custom-domain-using-oracle-cloud-and-nginx | |
# https://gielis1.rssing.com/chan-7657097/article208-live.html | |
# | |
location /ords/ { | |
proxy_pass http://host.containers.internal:8181/ords/; | |
proxy_http_version 1.1; | |
proxy_set_header Origin ""; | |
proxy_set_header Host $host:$server_port; | |
proxy_set_header X-Forwarded-Host $host:$server_port; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_connect_timeout 600; | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; | |
} | |
} |
/ # cd /etc/nginx/conf.d
/etc/nginx/conf.d # ls default.conf
default.conf
/etc/nginx/conf.d # vi default.conf
default.confの内容を置き換える
/etc/nginx/conf.d # exit
%
nginxのコンテナを再起動します。
% podman restart nginx
nginx
%
以上でnginxがリバース・プロキシとして動作するようになりました。ORDSのページに接続します。
const channel = new BroadcastChannel('submit-message');
const chatMessage = apex.item("P1_TEXT").getValue();
channel.postMessage( { message: chatMessage } );
const channel = new BroadcastChannel('submit-message');
channel.addEventListener("message", (event) => {
console.log(event.data.message);
// iframe
const iframe = document.querySelector('iframe');
const input = iframe.contentDocument.getElementById("chat-input");
input.innerText = event.data.message;
// send-message-buttonが表示されるまで待つ。
setTimeout(() => {
const button = iframe.contentDocument.getElementById("send-message-button");
button.click();
}, 1000);
});