add a header to incoming http request in a server
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a ubuntu 16.04 server. It runs nginx webserver for the frontend part. Also the backend application runs in the same server.
Now the requirement is to add header to incoming http requests. And we need to add header to the request coming from specific sources (IPs) only.
For Example:
users hit the following URL:
http://abc.example.com/live/xyz
As soon as the server receives this request, we need to change it to:
http://abc.example.com/live/xyz?token=akjshdfhkajshkj
How can we achieve this in ubuntu?As I searched I have found that HAproxy and nginx itself can be used to add header or is there any other better alternative. It would be of great help if someone could please help to get a solution for this.
Thanks in advance!
ubuntu nginx webserver http haproxy
add a comment |Â
up vote
0
down vote
favorite
I have a ubuntu 16.04 server. It runs nginx webserver for the frontend part. Also the backend application runs in the same server.
Now the requirement is to add header to incoming http requests. And we need to add header to the request coming from specific sources (IPs) only.
For Example:
users hit the following URL:
http://abc.example.com/live/xyz
As soon as the server receives this request, we need to change it to:
http://abc.example.com/live/xyz?token=akjshdfhkajshkj
How can we achieve this in ubuntu?As I searched I have found that HAproxy and nginx itself can be used to add header or is there any other better alternative. It would be of great help if someone could please help to get a solution for this.
Thanks in advance!
ubuntu nginx webserver http haproxy
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a ubuntu 16.04 server. It runs nginx webserver for the frontend part. Also the backend application runs in the same server.
Now the requirement is to add header to incoming http requests. And we need to add header to the request coming from specific sources (IPs) only.
For Example:
users hit the following URL:
http://abc.example.com/live/xyz
As soon as the server receives this request, we need to change it to:
http://abc.example.com/live/xyz?token=akjshdfhkajshkj
How can we achieve this in ubuntu?As I searched I have found that HAproxy and nginx itself can be used to add header or is there any other better alternative. It would be of great help if someone could please help to get a solution for this.
Thanks in advance!
ubuntu nginx webserver http haproxy
I have a ubuntu 16.04 server. It runs nginx webserver for the frontend part. Also the backend application runs in the same server.
Now the requirement is to add header to incoming http requests. And we need to add header to the request coming from specific sources (IPs) only.
For Example:
users hit the following URL:
http://abc.example.com/live/xyz
As soon as the server receives this request, we need to change it to:
http://abc.example.com/live/xyz?token=akjshdfhkajshkj
How can we achieve this in ubuntu?As I searched I have found that HAproxy and nginx itself can be used to add header or is there any other better alternative. It would be of great help if someone could please help to get a solution for this.
Thanks in advance!
ubuntu nginx webserver http haproxy
edited Feb 27 at 8:00
asked Feb 26 at 10:05
Samin Munankarmi
216
216
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Header means we need to add the first line to file.
sed -i 'li header content' filename.
header conent can be anything as per your requirement.
It would be helpful if you post sample input and output required
hello @Praveen Kumar BS I have edited the question by adding an example. hope this will explain the requirement.
â Samin Munankarmi
Feb 27 at 9:01
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Header means we need to add the first line to file.
sed -i 'li header content' filename.
header conent can be anything as per your requirement.
It would be helpful if you post sample input and output required
hello @Praveen Kumar BS I have edited the question by adding an example. hope this will explain the requirement.
â Samin Munankarmi
Feb 27 at 9:01
add a comment |Â
up vote
0
down vote
Header means we need to add the first line to file.
sed -i 'li header content' filename.
header conent can be anything as per your requirement.
It would be helpful if you post sample input and output required
hello @Praveen Kumar BS I have edited the question by adding an example. hope this will explain the requirement.
â Samin Munankarmi
Feb 27 at 9:01
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Header means we need to add the first line to file.
sed -i 'li header content' filename.
header conent can be anything as per your requirement.
It would be helpful if you post sample input and output required
Header means we need to add the first line to file.
sed -i 'li header content' filename.
header conent can be anything as per your requirement.
It would be helpful if you post sample input and output required
answered Feb 26 at 14:23
Praveen Kumar BS
1,010128
1,010128
hello @Praveen Kumar BS I have edited the question by adding an example. hope this will explain the requirement.
â Samin Munankarmi
Feb 27 at 9:01
add a comment |Â
hello @Praveen Kumar BS I have edited the question by adding an example. hope this will explain the requirement.
â Samin Munankarmi
Feb 27 at 9:01
hello @Praveen Kumar BS I have edited the question by adding an example. hope this will explain the requirement.
â Samin Munankarmi
Feb 27 at 9:01
hello @Praveen Kumar BS I have edited the question by adding an example. hope this will explain the requirement.
â Samin Munankarmi
Feb 27 at 9:01
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f426639%2fadd-a-header-to-incoming-http-request-in-a-server%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password