Hi,
It is also for new.domain.com:8080 to new.domain.com. However, here is my nginx conf;
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name jira.domain.com www.jira.domain.com;
return 301 https://$server_name$request_uri;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://jira.domain.com;
client_max_body_size 10M;
}
}
server {
listen 443 ssl;
server_name jira.domain.com;
ssl_certificate /etc/pki/tls/ssl/ssl_certificate.crt;
ssl_certificate_key /etc/pki/tls/ssl/private.key;
ssl_trusted_certificate /etc/pki/tls/ssl/IntermediateCA.crt;
# NGINX usually only allows 1M per request. Increase this to JIRA's maximum attachment size (10M by default)
client_max_body_size 10M;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080;
}
location /kb {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8090/kb;
}
}
In this configuration, everthing works fine. I'm wondering is it possible forwarding jira.domain.com:8080 to jira.domain.com? I've tried almost everything.
Hey Ali,
Something like the below should work - only listens for requests from oldjira.domain.com and then redirects to new.domain.com which will then be handled by the server blocks you've referenced above.
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name oldjira.domain.com;
return 301 https://new.domain.com$request_uri;
}
CCM
Thank you so much but it will be duplicated when i add those. I've tried like that;
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name new.domain.com www.new.domain.com oldjira.domain.com;
return 301 https://$server_name$request_uri;
...
In this case, oldjira.domain.com redirected to new.domain.com, ok but I want oldjira.domain.com:8080 to new.domain.com. Is it possible?
When I try to access to oldjira.domain.com:8080 I'm getting new jira but logins not working because of the base URL. Please check attached ss.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should not be doing this with proxies or rewrites, you need to use absolute redirects. When a user lands on <old url>, they should be fully redirected to <new url>, not have the server present the old url on the new one. Anything browser landing on <old url> should have the address changed to <new url>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ali,
since only one application can bind to a port (8080) which for your current config is Jira - and it won’t/can’t (that I know of) force a redirect to the baseURL, I see two options.
1 - change the DNS on oldjira.domain.com to another server that can have nginx/Apache listen on :8080 and handle the redirect
2 - change your new JIRA port from 8080 to something else, point your current proxypass value from 8080 to the new port. Once you’ve done this, you’ll be able to get your current nginx to listen on :8080 and redirect to newjira.donain.com
With both options, you should pretty much just need to change the listen directive in the example I posted earlier from 80 to 8080
(https://serverfault.com/questions/655067/is-it-possible-to-make-nginx-listen-to-different-ports)
CCM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you, I was wondering if it's possible to make on the same server.
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.