Let's say I have a sub domain for example cute design. Now I want to create a webserver that has the following subdomain. Is it possible to auto start ngrok every time with this subdomain?
If you are using windows you can just create a batch file that auto starts ngrok with your port and subdomain ready to go.
Just save a document called cutedesign.bat in the same directory that you have ngrok.exe located with 1 line in it like this:
ngrok http --subdomain=cutedesign {yourport}
It is not included in free plan.
This works for me
ngrok http -host-header=rewrite [your-custom-local-domain]:[port]
UNIX
Create an alias
alias ngrok='function _ngrok(){ ngrok http -subdomain=cutedesign $1; };_ngrok'
Related
Like the title says it, I need to configure my server to that it is reachable via the IP. I'm just asking where i can redirect/reroute it in the config?
Thanks
So i found out that in the nginx config you have to add an ip and an DNS Entry and it works :)
I have a domain just bought. Say it is: myowndomain.com. I have added A record with my SERVER IP address. We have two applications on our server. One is with port 3000 and other is with port 3001.
Now I would like to access my applications through this domain. It is working now when I call it by myowndomain.com:3000 and myowndomain.com:3001.
How to setup the system to load port 3000's application if I call myowndomain.com and load 3001's application if I call my.myowndomain.com. [subdomain my.myowndomain.com is also added in godaddy]
Simple. I just have to add domain name alias in HTTP binding and save.
I think you need to do this by using URL Rewriting.
Please have a look on below link from iis, here is given complete demo how you can do this:
https://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module
you can install ur rewriting from here:
https://www.iis.net/downloads/microsoft/url-rewrite
by using this on your applications you can move individual pages also to a specific url. hopefully it will resolve your problem.
Is it possible, without editing the /etc/hosts file, tell my computer redirect to 127.0.0.1 every time I visit domain1.com or domain1.com through the web browser as well as when I request the content of the same pages through curl?
Run a DNS server/resolver on your machine, configure to forward every query that it can't resolve to the DNS resolvers upstream and set /etc/resolv.conf to direct all queries to the locally running resolver.
Then in the local resolver add entries for the domains you want to blackhole toward localhost.
There are several of options to chose from. The currently most popular caching resolver is unbound, but you can also use dnscache for it.
I'm using ngrok (free account) in my localhost for my coded web server written in Go
In Ubuntu, after starting my server (which listens on port 3000), I run this command to start ngrok:
./ngrok http 3000
Then other PC can get access to my demo web by path provided by ngrok, for instance, http://6fed323a.ngrok.io
But when they do something on it (for example, click on a button that redirects), the host of URL becomes localhost again
There isn't any functions of ngrok that allows access to all routes in server, is there? I'm learning
I just ran into this issue, the reason for this is because your button uses a straight absolute path redirect which ngrok (or any tunneling service ive used so far) cannot handle. You need to use a relative path redirect such as:
window.location.href = '/path';
In general, it is considered best practice to always use relative urls so that the app is not bound to the hostname. Of course, this is in an ideal work- most legacy apps may not follow this unfortunately.
While I was working on a Rails app I wanted to run it on ngrok but I got error below:
The connection to http://xxxxxx.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:3000.
It seems like ngrok works fine but my local server is not. Which is true since I forgot to run my rails app first by run $ rails s. By doing so I was able to get ngrok tunneing works fine.
Make sure your local server run first.
I have noticed ngrok url changes to localhost url when I click on site logo which is defined as root_path in my route file. But other links and header tabs for example works fine and shows ngrok url.
Good luck.
I've struggled for couple of weeks on this configuration.What I want to achieve can be listed as follows.
1.I registered a domain not long ago.And I've set up some web service on my VPS,such as a blog,a forum and Owncloud. Now I want to configured the Nginx so that I can run all the service on one VPS and one IP address. In order to run owncloud,I have to modify the /etc/php5/fpm/pool.d/www.confto listen = 9000.In this case,I can only get one service (Owncloud)function,because if I want to run the forum I must uncomment the listen = /var/run/php5-fpm.sock.What's more,I've tried to uncomment both of them,Nginx showed 502 afterwards.
2.I'm using Hexo as my blog.When I start the server,I can access into my blog on IP:4000.So I wonder if I could run my blog server on background and edit the posts online via a subdomain which has been redirected to port 4000.If it's possible,should I modify the nginx.conf or add something in sites-available?
3.Can I deploy different web services on different subdomain?Which file is to modify?It's said that I can achieve this by using reverse proxy?
Sorry for the pathetic English and expression.Thanks in advance.
Going at it point by point:
The advantage of PHP-FPM, which you are using, is that you can have multiple separate interpreters running in your pool. To do so, simply copy the file at /etc/php5/fpm/pool.d/www.conf to somewhere else, say /etc/php5/fpm/pool.d/forum.conf, change the listen directive, and you've got a second php interpreter running, entirely separate from the first one. That way owncloud (www) and your forum (forum) have their own distinct php.
This is called reverse-proxying. nginx does that well. You simply add a new site definition in sites-available that does reverse-proxying to port 4000 on your server, then symlink (or copy) that site definition to sites-enabled and restart nginx. You will have to setup Hexo to start automatically for that to work.
You can deploy different web services on different subdomains. As long as the dns is configured to point that name to your server, you can configure the server to respond differently for every subdomain using site definitions. You need to modify the files in sites-enabled to determine which names nginx knows how to respond to.