I have Nginx installed on my machine and serve 2 domains.
- https://example.com/ -> Frontend.
- https://api.example.com/ -> Backend.
I'm communicating backend application through the frontend, But it's seem to be that the backend application does not receive any header from the Nginx.
This is my Nginx.conf:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
events {} # event context needs to be defined to consider config valid
http{
include /etc/nginx/mime.types;
server {
listen 80;
root /usr/share/nginx/html;
server_name studenttracker.co.il;
location / {
try_files $uri $uri/ /index.html;
}
}
server {
listen 80;
server_name api.studenttracker.co.il;
location / {
proxy_pass_request_headers on;
proxy_pass http://159.223.2.114:8443;
proxy_set_header Host api.studenttracker.co.il;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Cookie $http_cookie;
}
}
}
The backend application except to receive 2 headers in order to get authorized PARAM_ID_AUTH
and PARAM_X_AUTH
.
While sending it, It's seem to be that the header does not arrive to the backend application at all.
I will Appreciate you help, Thanks!