Welcome! Log In Create A New Profile

Advanced

nginx server

Posted by Metasoftbali 
nginx server
April 29, 2024 02:59AM
hi guys plase help.

i have a problem with nginx conf settings,
i have a backend server that provides an api :
say:

>> 192.168.2.248 (windows server)
this is also used for webhooks

and other servers:
>> 192.168.2.44 (ubuntu - nginx )
run web application


this is the configuration :
server {
listen 80;
listen 443 ssl;
client_max_body_size 10M;
root /var/www/aio-commerce.com/html;
index index.html index.htm index.nginx-debian.html;
ssl_certificate /var/www/aio-commerce.com/html/localhost.crt;
ssl_certificate_key /var/www/aio-commerce.com/html/localhost.key;

server_name 192.168.2.244;

location / {
# Serve static files or fallback to index.html
try_files $uri $uri/ /index.html?q=$uri&$args;
}

location /api {
# Proxy settings for webhook requests
proxy_pass http://192.168.2.248/api/;
proxy_set_header X-Forward-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;

# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

# Pass the 'Cookie' header
proxy_set_header Cookie $http_cookie;
}
}



Edited 1 time(s). Last edit at 04/29/2024 03:02AM by Metasoftbali.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 190
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