<VirtualHost *:80>RewriteEngine onRewriteCond %{SERVER_PORT} !^443$RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]ServerAdmin admin@xxxxxxxxxxxxServerName stevenshi.meServerAlias www.stevenshi.meDocumentRoot /var/www/htmlErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost><IfModule mod_ssl.c><VirtualHost *:443>ServerAdmin admin@xxxxxxxxxxxxServerName stevenshi.me:443ServerAlias www.stevenshi.meDocumentRoot /var/www/htmlSSLProxyEngine onSSLEngine onSSLProtocol all -SSLv2SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUMSSLCertificateFile /etc/apache2/ssl/ssl.crtSSLCertificateKeyFile /etc/apache2/ssl/private.keySSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pemProxyRequests onProxyPreserveHost on<Proxy *>Order deny,allowAllow from localhost</Proxy>ProxyPass /projects/CS32Brewer/ http://localhost:2000/ProxyPassReverse /projects/CS32Brewer/ http://localhost:2000/#ProxyPassReverse /projects/CS32Brewer/ http://localhost:2000/#ProxyPass /projects/Maps http://locahost:2001#ProxyPassReverse /projects/Maps http://localhost:2001ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost></IfModule>
On Tue, Aug 25, 2015 at 3:46 PM, Steven Shi <steven200796@xxxxxxxxx> wrote:yes, they are both located on port 2000. I am indeed using the reverse proxy option.Some clarification needed here.
Is the app and the jetty backend on the same server? If so, are you using the reverse proxy option because jetty typically would listen on port 80 and is on a different server from the app but you have a need for app and jetty on the same server so the jetty needed an alternate port?We seem to have a language barrier. Robert was asking if you were using port 2000 for the Jetty server because it and the Apache web server were running on the same system. The only way they could "both [be] located on port 2000" is if they were running on different systems. You can't have two programs listening on the same TCP/IP port number.Your private email to me makes it clear that you have an Apache http server handling requests on port 80 and and a Jetty http server handling requests on port 2000. Both servers are running on the same system. The "app" is using the jQuery _javascript_ library to handle HTTP requests. Whether or not the jQuery code is running in a browser controlled by a human is probably irrelevant. Nonetheless it might be helpful to know if the "app" is in fact browser side client code or something else.Back to your original problem statement:"Unfortunately, whenever the app makes a GET/POST request, the port 2000 is lost and the request is made to localhost:80 rather than localhost:2000."So we now know that "the app" is a jQuery program issuing a HTTP request with a URI like "/app/something" to the Apache httpd server on port 80. The Apache httpd server should be proxying the request to the Jetty server on port 2000 on the same system minus the "/app" URI prefix but is not doing so.What do you mean by "the port 2000 is lost"? What data leads you to believe the Apache httpd server is not proxying the request?Do you have virtual hosts defined in the Apache httpd server? If so have you confirmed "the app" is setting the HTTP_HOST header correctly?When I'm baffled by the behavior of my Apache httpd server I enable additional diagnostic output. For example,LoadModule dumpio_module libexec/apache2/mod_dumpio.so
LogLevel trace6
DumpIOInput On
DumpIOOutput OnLogLevel dumpio_module:trace7I then issue a series of carefully constructed HTTP requests meant to eliminate irrelevant details and examine the error log for clues.--Kurtis RaderCaretaker of the exceptional canines Junior and Hank