Restrict SOAP calls using Nginx Reverse ProxySOAP or REST for Web Services?REST / SOAP endpoints for a WCF serviceRepresentational state transfer (REST) and Simple Object Access Protocol (SOAP)How to call a SOAP web service on AndroidHow to pass “Null” (a real surname!) to a SOAP web service in ActionScript 3?SOAP vs REST (differences)nginx docker proxy_path to an other docker in the servernginx reverse proxy setupApache reverse proxy with LDAP check on client certificate cnNGINX Reverse Proxy redirecting instead of proxying

Will number of steps recorded on FitBit/any fitness tracker add up distance in PokemonGo?

Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?

How much of a Devil Fruit must be consumed to gain the power?

Does Doodling or Improvising on the Piano Have Any Benefits?

How to convince somebody that he is fit for something else, but not this job?

What kind of floor tile is this?

Is there any evidence that Cleopatra and Caesarion considered fleeing to India to escape the Romans?

How do you make your own symbol when Detexify fails?

"It doesn't matter" or "it won't matter"?

What is Cash Advance APR?

Does "he squandered his car on drink" sound natural?

How to make money from a browser who sees 5 seconds into the future of any web page?

Why should universal income be universal?

Has any country ever had 2 former presidents in jail simultaneously?

I found an audio circuit and I built it just fine, but I find it a bit too quiet. How do I amplify the output so that it is a bit louder?

Creating two special characters

Are cause and effect the same as in our Universe in a non-relativistic, Newtonian Universe in which the speed of light is infinite?

Why do ¬, ∀ and ∃ have the same precedence?

Can I cause damage to electrical appliances by unplugging them when they are turned on?

A variation to the phrase "hanging over my shoulders"

awk assign to multiple variables at once

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?

Non-trope happy ending?

How could a planet have erratic days?



Restrict SOAP calls using Nginx Reverse Proxy


SOAP or REST for Web Services?REST / SOAP endpoints for a WCF serviceRepresentational state transfer (REST) and Simple Object Access Protocol (SOAP)How to call a SOAP web service on AndroidHow to pass “Null” (a real surname!) to a SOAP web service in ActionScript 3?SOAP vs REST (differences)nginx docker proxy_path to an other docker in the servernginx reverse proxy setupApache reverse proxy with LDAP check on client certificate cnNGINX Reverse Proxy redirecting instead of proxying













0















We have a Nginx server configured for reverse proxying to protect an aging SOAP server that can't be patched.



I've been asked to restrict what calls clients can make from specific IP ranges.



I've no idea how to allow some SOAP calls but filter out others.



The Nginux config is



server 
listen 443;
listen [::]:443;
server_name shiny.nginx.server;
ssl on;
ssl_certificate "/public/directory/proxy.pem";
ssl_certificate_key "/secret/directory/proxy.key";
location /
proxy_pass http://very.old.server:80/;
proxy_buffering off;
proxy_set_header Host $http_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;
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;




Any ideas how I achieve this?



Thanks










share|improve this question






















  • You might want to google before asking. scalescale.com/tips/nginx/redirect-nginx-traffic-client-ip

    – Adlan Arif Zakaria
    Mar 7 at 5:07












  • Thanks but the redirection is working. The problem is all SOAP calls/requests are allowed. We want to restrict what calls some users can make.

    – user1174838
    Mar 7 at 5:19











  • The idea is for you to check the IP, then check the url, then redirect, else return 404. This way you can specific specific IP to use specific URL only.

    – Adlan Arif Zakaria
    Mar 7 at 5:50











  • OK, but the URL doesn't contain the SOAP call. Looking at the access.log file, all I see is '192.168.1.67 - user [07/Mar/2019:11:16:06 +0800] "POST /vendor/SOAP/ HTTP/1.1" 200 285 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-"'. Using wireshark, I can see the SOAP call embedded in the XML its not on the URL

    – user1174838
    Mar 7 at 6:46















0















We have a Nginx server configured for reverse proxying to protect an aging SOAP server that can't be patched.



I've been asked to restrict what calls clients can make from specific IP ranges.



I've no idea how to allow some SOAP calls but filter out others.



The Nginux config is



server 
listen 443;
listen [::]:443;
server_name shiny.nginx.server;
ssl on;
ssl_certificate "/public/directory/proxy.pem";
ssl_certificate_key "/secret/directory/proxy.key";
location /
proxy_pass http://very.old.server:80/;
proxy_buffering off;
proxy_set_header Host $http_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;
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;




Any ideas how I achieve this?



Thanks










share|improve this question






















  • You might want to google before asking. scalescale.com/tips/nginx/redirect-nginx-traffic-client-ip

    – Adlan Arif Zakaria
    Mar 7 at 5:07












  • Thanks but the redirection is working. The problem is all SOAP calls/requests are allowed. We want to restrict what calls some users can make.

    – user1174838
    Mar 7 at 5:19











  • The idea is for you to check the IP, then check the url, then redirect, else return 404. This way you can specific specific IP to use specific URL only.

    – Adlan Arif Zakaria
    Mar 7 at 5:50











  • OK, but the URL doesn't contain the SOAP call. Looking at the access.log file, all I see is '192.168.1.67 - user [07/Mar/2019:11:16:06 +0800] "POST /vendor/SOAP/ HTTP/1.1" 200 285 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-"'. Using wireshark, I can see the SOAP call embedded in the XML its not on the URL

    – user1174838
    Mar 7 at 6:46













0












0








0








We have a Nginx server configured for reverse proxying to protect an aging SOAP server that can't be patched.



I've been asked to restrict what calls clients can make from specific IP ranges.



I've no idea how to allow some SOAP calls but filter out others.



The Nginux config is



server 
listen 443;
listen [::]:443;
server_name shiny.nginx.server;
ssl on;
ssl_certificate "/public/directory/proxy.pem";
ssl_certificate_key "/secret/directory/proxy.key";
location /
proxy_pass http://very.old.server:80/;
proxy_buffering off;
proxy_set_header Host $http_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;
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;




Any ideas how I achieve this?



Thanks










share|improve this question














We have a Nginx server configured for reverse proxying to protect an aging SOAP server that can't be patched.



I've been asked to restrict what calls clients can make from specific IP ranges.



I've no idea how to allow some SOAP calls but filter out others.



The Nginux config is



server 
listen 443;
listen [::]:443;
server_name shiny.nginx.server;
ssl on;
ssl_certificate "/public/directory/proxy.pem";
ssl_certificate_key "/secret/directory/proxy.key";
location /
proxy_pass http://very.old.server:80/;
proxy_buffering off;
proxy_set_header Host $http_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;
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;




Any ideas how I achieve this?



Thanks







soap nginx-reverse-proxy






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 4:59









user1174838user1174838

2271214




2271214












  • You might want to google before asking. scalescale.com/tips/nginx/redirect-nginx-traffic-client-ip

    – Adlan Arif Zakaria
    Mar 7 at 5:07












  • Thanks but the redirection is working. The problem is all SOAP calls/requests are allowed. We want to restrict what calls some users can make.

    – user1174838
    Mar 7 at 5:19











  • The idea is for you to check the IP, then check the url, then redirect, else return 404. This way you can specific specific IP to use specific URL only.

    – Adlan Arif Zakaria
    Mar 7 at 5:50











  • OK, but the URL doesn't contain the SOAP call. Looking at the access.log file, all I see is '192.168.1.67 - user [07/Mar/2019:11:16:06 +0800] "POST /vendor/SOAP/ HTTP/1.1" 200 285 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-"'. Using wireshark, I can see the SOAP call embedded in the XML its not on the URL

    – user1174838
    Mar 7 at 6:46

















  • You might want to google before asking. scalescale.com/tips/nginx/redirect-nginx-traffic-client-ip

    – Adlan Arif Zakaria
    Mar 7 at 5:07












  • Thanks but the redirection is working. The problem is all SOAP calls/requests are allowed. We want to restrict what calls some users can make.

    – user1174838
    Mar 7 at 5:19











  • The idea is for you to check the IP, then check the url, then redirect, else return 404. This way you can specific specific IP to use specific URL only.

    – Adlan Arif Zakaria
    Mar 7 at 5:50











  • OK, but the URL doesn't contain the SOAP call. Looking at the access.log file, all I see is '192.168.1.67 - user [07/Mar/2019:11:16:06 +0800] "POST /vendor/SOAP/ HTTP/1.1" 200 285 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-"'. Using wireshark, I can see the SOAP call embedded in the XML its not on the URL

    – user1174838
    Mar 7 at 6:46
















You might want to google before asking. scalescale.com/tips/nginx/redirect-nginx-traffic-client-ip

– Adlan Arif Zakaria
Mar 7 at 5:07






You might want to google before asking. scalescale.com/tips/nginx/redirect-nginx-traffic-client-ip

– Adlan Arif Zakaria
Mar 7 at 5:07














Thanks but the redirection is working. The problem is all SOAP calls/requests are allowed. We want to restrict what calls some users can make.

– user1174838
Mar 7 at 5:19





Thanks but the redirection is working. The problem is all SOAP calls/requests are allowed. We want to restrict what calls some users can make.

– user1174838
Mar 7 at 5:19













The idea is for you to check the IP, then check the url, then redirect, else return 404. This way you can specific specific IP to use specific URL only.

– Adlan Arif Zakaria
Mar 7 at 5:50





The idea is for you to check the IP, then check the url, then redirect, else return 404. This way you can specific specific IP to use specific URL only.

– Adlan Arif Zakaria
Mar 7 at 5:50













OK, but the URL doesn't contain the SOAP call. Looking at the access.log file, all I see is '192.168.1.67 - user [07/Mar/2019:11:16:06 +0800] "POST /vendor/SOAP/ HTTP/1.1" 200 285 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-"'. Using wireshark, I can see the SOAP call embedded in the XML its not on the URL

– user1174838
Mar 7 at 6:46





OK, but the URL doesn't contain the SOAP call. Looking at the access.log file, all I see is '192.168.1.67 - user [07/Mar/2019:11:16:06 +0800] "POST /vendor/SOAP/ HTTP/1.1" 200 285 "-" "Apache-HttpClient/4.1.1 (java 1.5)" "-"'. Using wireshark, I can see the SOAP call embedded in the XML its not on the URL

– user1174838
Mar 7 at 6:46












1 Answer
1






active

oldest

votes


















0














I'v found a solution to this.



server {
listen 443;
listen [::]:443;
server_name shiny.nginx.server;
ssl on;
ssl_certificate "/public/directory/proxy.pem";
ssl_certificate_key "/secret/directory/proxy.key";
location /
proxy_pass http://very.old.server:80/;
proxy_buffering off;
proxy_set_header Host $http_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;
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;

if ($remote_addr ~ 192.168.1.1)
set $is_user Y;

if ($http_soapaction ~ SOAP/Request/Goes/Here)
set $user_allowed Y;

set $user_test "$is_user$user_allowed";
if ($user_test = YY)
set $good yes;


if ($good != yes)
return 403;




Not being able to do nested or complex tests made it a bit tricky...






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036383%2frestrict-soap-calls-using-nginx-reverse-proxy%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I'v found a solution to this.



    server {
    listen 443;
    listen [::]:443;
    server_name shiny.nginx.server;
    ssl on;
    ssl_certificate "/public/directory/proxy.pem";
    ssl_certificate_key "/secret/directory/proxy.key";
    location /
    proxy_pass http://very.old.server:80/;
    proxy_buffering off;
    proxy_set_header Host $http_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;
    auth_basic "Username and Password Required";
    auth_basic_user_file /etc/nginx/.htpasswd;

    if ($remote_addr ~ 192.168.1.1)
    set $is_user Y;

    if ($http_soapaction ~ SOAP/Request/Goes/Here)
    set $user_allowed Y;

    set $user_test "$is_user$user_allowed";
    if ($user_test = YY)
    set $good yes;


    if ($good != yes)
    return 403;




    Not being able to do nested or complex tests made it a bit tricky...






    share|improve this answer



























      0














      I'v found a solution to this.



      server {
      listen 443;
      listen [::]:443;
      server_name shiny.nginx.server;
      ssl on;
      ssl_certificate "/public/directory/proxy.pem";
      ssl_certificate_key "/secret/directory/proxy.key";
      location /
      proxy_pass http://very.old.server:80/;
      proxy_buffering off;
      proxy_set_header Host $http_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;
      auth_basic "Username and Password Required";
      auth_basic_user_file /etc/nginx/.htpasswd;

      if ($remote_addr ~ 192.168.1.1)
      set $is_user Y;

      if ($http_soapaction ~ SOAP/Request/Goes/Here)
      set $user_allowed Y;

      set $user_test "$is_user$user_allowed";
      if ($user_test = YY)
      set $good yes;


      if ($good != yes)
      return 403;




      Not being able to do nested or complex tests made it a bit tricky...






      share|improve this answer

























        0












        0








        0







        I'v found a solution to this.



        server {
        listen 443;
        listen [::]:443;
        server_name shiny.nginx.server;
        ssl on;
        ssl_certificate "/public/directory/proxy.pem";
        ssl_certificate_key "/secret/directory/proxy.key";
        location /
        proxy_pass http://very.old.server:80/;
        proxy_buffering off;
        proxy_set_header Host $http_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;
        auth_basic "Username and Password Required";
        auth_basic_user_file /etc/nginx/.htpasswd;

        if ($remote_addr ~ 192.168.1.1)
        set $is_user Y;

        if ($http_soapaction ~ SOAP/Request/Goes/Here)
        set $user_allowed Y;

        set $user_test "$is_user$user_allowed";
        if ($user_test = YY)
        set $good yes;


        if ($good != yes)
        return 403;




        Not being able to do nested or complex tests made it a bit tricky...






        share|improve this answer













        I'v found a solution to this.



        server {
        listen 443;
        listen [::]:443;
        server_name shiny.nginx.server;
        ssl on;
        ssl_certificate "/public/directory/proxy.pem";
        ssl_certificate_key "/secret/directory/proxy.key";
        location /
        proxy_pass http://very.old.server:80/;
        proxy_buffering off;
        proxy_set_header Host $http_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;
        auth_basic "Username and Password Required";
        auth_basic_user_file /etc/nginx/.htpasswd;

        if ($remote_addr ~ 192.168.1.1)
        set $is_user Y;

        if ($http_soapaction ~ SOAP/Request/Goes/Here)
        set $user_allowed Y;

        set $user_test "$is_user$user_allowed";
        if ($user_test = YY)
        set $good yes;


        if ($good != yes)
        return 403;




        Not being able to do nested or complex tests made it a bit tricky...







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        user1174838user1174838

        2271214




        2271214





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55036383%2frestrict-soap-calls-using-nginx-reverse-proxy%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved