<div dir="ltr"><div><div><div><div><div><div>As a quick update, setting<br></div>proxy_set_header Host $host;<br></div>seems
 to have gotten the URL working, but OSTicket is still giving me the 
same error I was getting when I was serving it with Nginx directly. 
Worse, the Apache2 access log shows none of my recent attempts to access
 the site, though it does show older ones. The Nginx access log shows all the accesses, though. It's as though the proxy 
weren't working properly at all. I have it set up in a location:<br><br></div>upstream apache2Redirect {<br></div><div>  server <a href="http://127.0.0.1:8080">127.0.0.1:8080</a>;<br>}<br><br></div><div>location / {<br></div>  proxy_set_header Host $host;<br></div>  proxy_pass <a href="http://apache2Redirect">http://apache2Redirect</a>;<br>}<br><br></div>My understanding is that the / will match everything, from /index.html to /images/small/235.jpg. Is that not the case? Do I need to do something to my location block, by chance?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 1:20 AM, Yuriy Medvedev <span dir="ltr"><<a href="mailto:medvedev.yp@gmail.com" target="_blank">medvedev.yp@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry, backend1 its upstream in nginx configuration<div><div>upstream backend1 {</div><div>  #ip of Apache back-end</div><div>  server <a href="http://192.168.0.1:8080" target="_blank">192.168.0.1:8080</a>;</div><div>}</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-05-13 1:59 GMT+03:00 Alex Hall <span dir="ltr"><<a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Thanks! I followed you, until the proxy_pass. What is backend1, and where is it defined? I know it's something you made up, but how does it know about Apache, or Apache about it?<div><div><br><div><blockquote type="cite"><div>On May 12, 2016, at 17:56, Yuriy Medvedev <<a href="mailto:medvedev.yp@gmail.com" target="_blank">medvedev.yp@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Hi, you can use vhost in Apache and configure proxy_pass in nginx configuration<div>For apache2 somthing like that</div><div><div><VirtualHost *:8080></div><div>  ServerName foo.bar</div><div><br></div><div>  DocumentRoot /home/sites/</div><div>  <Directory /home/sites/></div><div>      Order deny,allow</div><div>      Allow from all</div><div>  </Directory></div><div><br></div><div>  ErrorLog  /home/sites/logs/apache_error.log</div><div>  CustomLog /home/sites/logs/apache_access.log combined</div><div><br></div><div>etc.......</div><div></VirtualHost></div></div><div>For nginx</div><div><div>server {</div><div>    listen   80;</div><div>    server_name foo.bar;</div><div><br></div><div>    access_log /home/sites/logs/nginx_access.log;</div><div>    error_log /home/sites/logs/nginx_error.log;</div><div><br></div><div>    location / {</div><div>        proxy_pass  <a href="http://backend1/" target="_blank">http://backend1</a>;</div><div> etc.....</div><div>     }</div><div>}</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-13 0:34 GMT+03:00 Alex Hall <span dir="ltr"><<a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello all,<br></div>Here's what I'm trying to do. I have two sites, <a href="http://sd1.mysite.com/" target="_blank">sd1.mysite.com</a> and <a href="http://sd2.mysite.com/" target="_blank">sd2.mysite.com</a>. The fun part is that sd1 is a Flask app, served by Nginx. However, sd2 is OSTicket, which must be served by Apache, it seems. Of course, Apache and Nginx can't listen to port 80 at the same time, and as this is a subdomain on a local, Windows DNS, I can't make <a href="http://sd2.mysite.com/" target="_blank">sd2.mysite.com</a> point to myip:8080 or anything like that.<br><br></div>Thus, my best option appears to be this: Nginx listens to all incoming traffic on 80. If the request is for anything to do with sd1, it handles it just like it does now. However, if the request is for sd2, Nginx somehow hands off the request to Apache, then returns what Apache gives it back to the user.<br><br></div>I've heard that people use Apache and Nginx together, but I haven't found anyone who uses them to serve two subdomains, with Nginx as the "gateway" and handler of one subdomain, and Apache as the handler for the other subdomain. Is there any way to do this? Am I even making sense? Thanks for any ideas anyone has.<span><font color="#888888"><br clear="all"><div><div><div><div><br>-- <br><div><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div></div></div></div></font></span></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>
_______________________________________________<br>nginx mailing list<br><a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br><a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></div></blockquote></div><br></div></div></div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div>