I am using MVCSiteMap - http://mvcsitemap.codeplex.com/ - with Azure and I am trying to figure out how I can get it to remove the PORT number at the end of the generated sitemap.
Currently, I am getting
http://127.0.0.1:5100/
For this url and all others. Does anyone have any experience with this or know how to remove the port no ?
If you run your code on production (something.cloudapp.net), this port number should dissappear.
Related
I am working with a designer and I'd like them to have access to the interactions I've implemented on the site we're working on. However this time, I have 2 issues. My localhost is configured to a subdomain:
http://store.teststore:3000/ and we're on different networks. Is there anyway to work around this?
ngrok should work for you. Download and install it following these instructions here: https://ngrok.com/download. Documentation on how it is used can be found here https://ngrok.com/docs. Once installed running the below command should work for you (depending on the hosting environment):
ngrok http -host-header=rewrite store.teststore:3000
You will need to give the URL generated by ngrok and displayed in the cmd prompt to the designer.
Update: Handling absolute redirects
Based on your comment it sounds like, after login, your site does an absolute redirect (the full URL is specified). If it is possible I would change your code to do a relative redirect where the domain is omitted. You could also make your root domain configurable in the absolute redirect and configure it to be the ngrok domain provided for now. Lastly, you could attempt to configure your DNS with a CNAME record following ngroks Tunnels to custom domains documentation. This last option, however, requires a paid for ngrok subscription.
Install ngrok if you haven't yet and CD into your project directory and invoke ngrok. Note Your application must be running locally on the same port number ngrok will be running.
I'm running Traefik in a Docker container, with Wildfly in other container.
I have the following labels in Wildfly's docker-compose.yml:
- "traefik.web.port=8080"
- "traefik.web.frontend.rule=Host:temporary_wildfly_hostname"
- "traefik.admin.port=9990"
- "traefik.admin.frontend.rule=Host:temporary_wildfly_hostname;PathStrip:/console/"
I can access the main Wildfly, which is in port 8080. I've tried many ways to access the service in port 9990, but the only one which really works is when I use a different Host, which isn't what I want.
I've tried:
Added "traefik.frontend.passHostHeader=true" (even with .admin before .frontend)
Switching PathStrip with PathPrefixStrip, Path PathStripRegex or even PathPrefixStripRegex
Wildfly's management console uses port 9990, redirects from :8080/console and also uses :9990/console/*, so /console by itself is redundant and it shows "too many redirects" errors.
I really think this /console loop error is some kind of an issue. I've been searching online for alternative configurations for other reverse proxies, to see if I'm missing something, but all relate to the headers, which I've already tried.
Any hint on how can I solve this, keeping the same URL, but still redirecting to a different port than the main service?
Thanks a lot for your time and help.
Best regards,
Luis Nabais
You need to add a priority on each segment.
traefik.<segment_name>.frontend.priority=10
Thanks a lot for your answer.
The issue was related to the backend wildfly creates. It uses another URL, which is /management. So I solved it using the following traefik labels:
- "traefik.web.port=8080"
- "traefik.web.frontend.rule=Host:temporary_wildfly_hostname"
- "traefik.admin.port=9990"
- "traefik.admin.frontend.rule=Host:temporary_wildfly_hostname;PathPrefix:/console,/management"
I wrote a little Rack app the uses rack-proxy to make it look like apps that are running on different ports are actually different subdirectories of one domain. It works.
If I'm running notes on port 3001 and photos on 3002, then I'm able to go to localhost:3000/notes or localhost:3000/photos and everything works properly.
That's only helpful for running it locally. But if I want to run this same setup on Heroku I need to be able to proxy to/from different URLs, not just different ports. So when I change my code from setting env["HTTP_HOST"] to http://localhost:3001 for /notes, to instead set env["HTTP_HOST"] to http://sbbme-note.herokuapp.com for /notes, Rack blows up on me.
I thought it would Just Workâ˘. Unfortuntely, I'm missing something.
Errno::EADDRNOTAVAIL at /notes
Can't assign requested address - connect(2) for "http://sbbme-note.herokuapp.com" port 0
The full stack trace is in this gist.
https://gist.github.com/veganstraightedge/6d840377bf20b4b5f5db
The repo is homesteading/homesteading-router-rack. The master branch is the one working in local development mode only (multiple ports on localhost). The heroku-router branch is where I'm trying to use different (sub)domains instead of just different ports. heroku-router is the one that blows up (see gist above).
If you want to install this and try it on your own machine, this should work:
gem install homesteading
homesteading new mysite
cd mysite
homesteading server
open http://localhost:3000
I'm real close to being able to replace my years old pile of mono-rails with my constellation of apps approach in Homesteading. This router is the last main blocker. Any help would be greatly appreciated.
PS. My intial version is based on this blog post (livsey dot org/blog/2012/02/23/using-rack-proxy-to-serve-multiple-rails-apps-from-the-same-domain-and-port) and this Stack Overflow question/answer (stackoverflow dot com/questions/11057905/how-do-i-use-rackproxy-within-rails-to-proxy-requests-to-a-specific-path-to-an "How do I use Rack::Proxy within Rails to proxy requests to a specific path to another app - Stack Overflow").
Looking at the setup and the stack trace it looks like the proxy is atrying to connect to the sbbme-note app on port 0. Try adding
ENV['SERVER_PORT'] = '80'
You might also consider using the nginx build pack on heroku an implementing a forward proxy that way. I've used this build pack as a basic forward proxy and it has worked great. There are other nginx build packs that are designed to hook up to you application server (like unicorn) that might also be useful for this use.
The solution was a combination of Lukas' suggestion and fixing what I was originally doing.
I added this (as suggested by Lukas).
env['SERVER_PORT'] = 80
AND I removed the http:// from my env["HTTP_HOST"]
So, this:
env["HTTP_HOST"] = "http://#{app}"
became this:
env["HTTP_HOST"] = app
Thanks for your help, Lukas!
Today I installed v1.9.2 on win7 64-bit server at fixed ip address 192.168.1.99
When I attempt to open the neo4j web admin, using explicit url 192.168.1.99:7474/webadmin/, I get a timeout error. However, when I replace the url with localhost:7474/webadmin/, then I connect without a problem. This is also problematic for my internal webapp as no else can access it without the server url.
Both localhost and 192.168.1.99 worked flawlessly with v1.9.RC2
Can anyone help me resolve this so that I can use the explicit url?
Can anyone recreate this to make sure I am not losing my mind?
Update: I also uncommented the line "org.neo4j.server.webserver.address=0.0.0.0" in the neo4j-server.properties file. When commented, the database only listens on localhost (only accept local connections). This had no effect.
Update2: worked on some javascript - found a bug, fixed it, and now the explicit url is working. Not sure if this is a coincidence. Regardless, hope uncommenting "org.neo4j.server.webserver.address=0.0.0.0" in the neo4j-server.properties file helps someone.
Thanks,
Jeff
How can I run forge web on a different port? I couldn't find anything on the docs.
Sorry, you can't yet! If you desperately need to change it, see the run_web method in .template/generate_dynamic/web_tasks.py.
NB if you alter the port there manually, changes will be lost if we re-download your templates!
We do have a better solution on the way, as the TODO implies...