configuring subdirectory in a wordpress installation for proxy pass to docker applicationHow to make nginx reverse proxy let 503 error pages pass through to client?Blank Page: wordpress on nginx+php-fpmNginx proxy pass works for https but not httpnginx load balancer rewrite to listen portnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakCodeIgniter nginx rewrite rules for i8ln URL'sNginx reverse proxy to many local servers + webserver duty

Determine direction of mass transfer

Complications of displaced core material?

'Select @VAR =' and 'Set @VAR =' behaving unexpectedly

Would cybernetic implants allow humans to use biofeedback to boost their performance to superhuman levels? If so how far could we take it?

Are there guidelines for finding good names for LaTeX 2e packages and control sequences defined in these packages?

Maximum interval between Alto & Tenor, & intervals when writing for SATB

Split into three!

Status of proof by contradiction and excluded middle throughout the history of mathematics?

Did significant numbers of Japanese officers escape prosecution during the Tokyo Trials?

Is it normal to "extract a paper" from a master thesis?

Unary Enumeration

Handling decimals in somewhat complex math

Comparison of bool data types in C++

What did the 'turbo' button actually do?

How to deceive the MC

(For training purposes) Are there any openings with rook pawns that are more effective than others (and if so, what are they)?

If I arrive in the UK, and then head to mainland Europe, does my Schengen visa 90 day limit start when I arrived in the UK, or mainland Europe?

Knight's Tour on a 7x7 Board starting from D5

What happened to the Dothraki in S08E06?

Why did it take so long for Germany to allow electric scooters / e-rollers on the roads?

Could a rotating ring space station have a bolo-like extension?

Are there historical examples of audiences drawn to a work that was "so bad it's good"?

Why does Bran want to find Drogon?

Are cells guaranteed to get at least one mitochondrion when they divide?



configuring subdirectory in a wordpress installation for proxy pass to docker application


How to make nginx reverse proxy let 503 error pages pass through to client?Blank Page: wordpress on nginx+php-fpmNginx proxy pass works for https but not httpnginx load balancer rewrite to listen portnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakCodeIgniter nginx rewrite rules for i8ln URL'sNginx reverse proxy to many local servers + webserver duty






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I have a wordpress installation using Nginx as the web server, now there is a need of adding moodle as the LMS to the same site, as a subdirectory, for example; www.mysite.com is where the wordpress site works then moodle would be www.mysite.com/learn.



This moodle runs in the same machine in a docker container which uses the bitnami moodle image; port 8081 is mapped to port 80 of the docker container i.e.



docker run -d -p 8081:80 -p 4443:443 --name moodle



I added a location block before wordpress configuration to the nginx config



location /learn 
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-Host $server_name;
proxy_pass http://0.0.0.0:8081;



the php configuration for wordpress is as follows



# Pass the PHP scripts to FastCGI server (locally with unix: param to avoid network overhead)
location ~ .php$
# Prevent Zero-day exploit
try_files $uri =404;

fastcgi_split_path_info ^(.+.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param APP_ENV production;
include fastcgi_params;



However this still gives a 404 response when I access www.amysite.com/learn



I checked the docker proxy is running bound to all IP addresses



/usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8081 -container-ip 172.19.0.3 -container-port 80



also a wget to localhost:8081 gives the moodle installation home page so I'm led to belive it is definitely a problem with my location block; or it is the Zero Day exploit config try_files $uri =404; causing the issue, even if so, I still can't remove that line.



Update



This configuration worked



location ~ ^/apply/(.*)$ 
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-Host $server_name;
proxy_pass http://0.0.0.0:8081/$1;



I can reach Moodle home page but all further URLs break because Moodle is not aware of generating links with the /learn context root; think I'll have to reconfigure Moodle to generate /learn context URLS










share|improve this question






























    1















    I have a wordpress installation using Nginx as the web server, now there is a need of adding moodle as the LMS to the same site, as a subdirectory, for example; www.mysite.com is where the wordpress site works then moodle would be www.mysite.com/learn.



    This moodle runs in the same machine in a docker container which uses the bitnami moodle image; port 8081 is mapped to port 80 of the docker container i.e.



    docker run -d -p 8081:80 -p 4443:443 --name moodle



    I added a location block before wordpress configuration to the nginx config



    location /learn 
    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-Host $server_name;
    proxy_pass http://0.0.0.0:8081;



    the php configuration for wordpress is as follows



    # Pass the PHP scripts to FastCGI server (locally with unix: param to avoid network overhead)
    location ~ .php$
    # Prevent Zero-day exploit
    try_files $uri =404;

    fastcgi_split_path_info ^(.+.php)(/.+)$;
    #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

    fastcgi_pass unix:/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param APP_ENV production;
    include fastcgi_params;



    However this still gives a 404 response when I access www.amysite.com/learn



    I checked the docker proxy is running bound to all IP addresses



    /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8081 -container-ip 172.19.0.3 -container-port 80



    also a wget to localhost:8081 gives the moodle installation home page so I'm led to belive it is definitely a problem with my location block; or it is the Zero Day exploit config try_files $uri =404; causing the issue, even if so, I still can't remove that line.



    Update



    This configuration worked



    location ~ ^/apply/(.*)$ 
    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-Host $server_name;
    proxy_pass http://0.0.0.0:8081/$1;



    I can reach Moodle home page but all further URLs break because Moodle is not aware of generating links with the /learn context root; think I'll have to reconfigure Moodle to generate /learn context URLS










    share|improve this question


























      1












      1








      1








      I have a wordpress installation using Nginx as the web server, now there is a need of adding moodle as the LMS to the same site, as a subdirectory, for example; www.mysite.com is where the wordpress site works then moodle would be www.mysite.com/learn.



      This moodle runs in the same machine in a docker container which uses the bitnami moodle image; port 8081 is mapped to port 80 of the docker container i.e.



      docker run -d -p 8081:80 -p 4443:443 --name moodle



      I added a location block before wordpress configuration to the nginx config



      location /learn 
      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-Host $server_name;
      proxy_pass http://0.0.0.0:8081;



      the php configuration for wordpress is as follows



      # Pass the PHP scripts to FastCGI server (locally with unix: param to avoid network overhead)
      location ~ .php$
      # Prevent Zero-day exploit
      try_files $uri =404;

      fastcgi_split_path_info ^(.+.php)(/.+)$;
      #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

      fastcgi_pass unix:/run/php/php7.1-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param APP_ENV production;
      include fastcgi_params;



      However this still gives a 404 response when I access www.amysite.com/learn



      I checked the docker proxy is running bound to all IP addresses



      /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8081 -container-ip 172.19.0.3 -container-port 80



      also a wget to localhost:8081 gives the moodle installation home page so I'm led to belive it is definitely a problem with my location block; or it is the Zero Day exploit config try_files $uri =404; causing the issue, even if so, I still can't remove that line.



      Update



      This configuration worked



      location ~ ^/apply/(.*)$ 
      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-Host $server_name;
      proxy_pass http://0.0.0.0:8081/$1;



      I can reach Moodle home page but all further URLs break because Moodle is not aware of generating links with the /learn context root; think I'll have to reconfigure Moodle to generate /learn context URLS










      share|improve this question
















      I have a wordpress installation using Nginx as the web server, now there is a need of adding moodle as the LMS to the same site, as a subdirectory, for example; www.mysite.com is where the wordpress site works then moodle would be www.mysite.com/learn.



      This moodle runs in the same machine in a docker container which uses the bitnami moodle image; port 8081 is mapped to port 80 of the docker container i.e.



      docker run -d -p 8081:80 -p 4443:443 --name moodle



      I added a location block before wordpress configuration to the nginx config



      location /learn 
      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-Host $server_name;
      proxy_pass http://0.0.0.0:8081;



      the php configuration for wordpress is as follows



      # Pass the PHP scripts to FastCGI server (locally with unix: param to avoid network overhead)
      location ~ .php$
      # Prevent Zero-day exploit
      try_files $uri =404;

      fastcgi_split_path_info ^(.+.php)(/.+)$;
      #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

      fastcgi_pass unix:/run/php/php7.1-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_param APP_ENV production;
      include fastcgi_params;



      However this still gives a 404 response when I access www.amysite.com/learn



      I checked the docker proxy is running bound to all IP addresses



      /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8081 -container-ip 172.19.0.3 -container-port 80



      also a wget to localhost:8081 gives the moodle installation home page so I'm led to belive it is definitely a problem with my location block; or it is the Zero Day exploit config try_files $uri =404; causing the issue, even if so, I still can't remove that line.



      Update



      This configuration worked



      location ~ ^/apply/(.*)$ 
      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-Host $server_name;
      proxy_pass http://0.0.0.0:8081/$1;



      I can reach Moodle home page but all further URLs break because Moodle is not aware of generating links with the /learn context root; think I'll have to reconfigure Moodle to generate /learn context URLS







      nginx php reverse-proxy docker






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 10 at 3:52







      Anadi Misra

















      asked May 9 at 3:47









      Anadi MisraAnadi Misra

      3281719




      3281719




















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "2"
          ;
          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%2fserverfault.com%2fquestions%2f966488%2fconfiguring-subdirectory-in-a-wordpress-installation-for-proxy-pass-to-docker-ap%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Server Fault!


          • 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%2fserverfault.com%2fquestions%2f966488%2fconfiguring-subdirectory-in-a-wordpress-installation-for-proxy-pass-to-docker-ap%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

          How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

          What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

          Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?