richardk wrote:Everything else is fine except for the cgi.server_port variable being wrong?
Yeah, and now that you mention it, I'm not sure how that's possible. I have a different site on a different server (IIS) running on port 80, but the site that's running Apache on port 8880 is the one that's showing port 80. I'm starting to suspect if may be a bug in my J2EE app server, which is something called Caucho Resin (not too familiar with it).
richardk wrote:Some things to try:
Put the following in your .htaccess file
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
# Get the port from the original request.
RewriteRule ^one$ /two?sp1=%{SERVER_PORT} [QSA,L]
# Get the port after a rewrite.
RewriteRule ^two$ /three?sp2=%{SERVER_PORT} [QSA,L]
# Get the port after another rewrite.
RewriteRule ^three$ /four?sp3=%{SERVER_PORT} [QSA,R,L]
Go to /one and it should redirect to show the ports at each step. This will show if rewriting is the problem.
That shows the correct port.
richardk wrote:What happens if you don't use a <VirtualHost> and just set the server to listen on port 8880? This will show if the problem is Apache/mod_rewrite or the other modules your are using.
Same thing, although I'm currently already only listening on port 8880.
richardk wrote:I also found this thread: Error in CGI.server_port.
That's an interesting link. They basically found a bug in their Java server that was causing the problem. I'll try asking the Resin folks if this may be an issue with their server.