Welcome! Log In Create A New Profile


azure container app

Posted by locquetda 
azure container app
March 26, 2024 05:21AM
Hi all,

We are carrying out tests to make API requests for a service which is located in a container environment under Azure.
To request this service we use the nginx solution. The service we question and mimir de grafana.

My problem is the following:
When the proxy_pass contains the target hostname, I get the 403 error.
When the proxy_pass contains the target IP, it works
On the nginx command console, when I curl target hostname, it works.
I can't leave the IP address, because it is a dynamic IP address.
From nginx I can clearly see the call arriving, however I don't see anything on the target (mimir).

this the config of nginx:

worker_processes 1;

events {
worker_connections 1024;

http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;

server {
listen 80;
server_name localhost;

location /prometheus/api/v1/ {
proxy_pass http://mimir_service/prometheus/api/v1/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

add_header 'Access-Control-Allow-Origin' '*';
proxy_redirect off;
proxy_set_header X-NginX-Proxy true;


An idea of problem ?
Re: azure container app
March 28, 2024 07:06AM
Ok the problem is resolved.
My error is to have repositioned the values in the proxypass like /prometheus/api/v1, it was just enough to define location /prometheus/ {
proxy_pass http://mimir_service/;
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 330
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready