Это видео недоступно.
Сожалеем об этом.
How to Redirect from WWW to Non-WWW on NGINX. Works for Http to Https too!
HTML-код
- Опубликовано: 16 окт 2017
- This tutorial shows you how to redirect www to non-www on Nginx or how to redirect from non-secure to secure ports in Nginx. This can be helpful for many reasons.
This technique is the best for SEO friendly site-wide redirects. All the redirects are 301 permanent redirects, meaning that if someone chooses to link to your site as a www. site it will still go to the right page within the site and it will still pass the link juice onto the real page.
A lot of other great stuff on this channel, be sure to subscribe to see other great tutorials like this one.
==== FOLLOW ME ====
Subscribe for New Releases!
Subscribe to DevMarketer Insider
confirmsubscri...
Twitter - / _jacurtis
(ask me questions!)
==== QUESTIONS? ====
Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.
Email me hello@jacurtis.com
Thanks for all your support!
Tags FTW. Nginx redirect from www to no www. Ngnix or Nginx both work. Secure site redirect. Permanent redirect in config configuration file. Help redirect nginx. ssh into server with username and password. Configuration file sites-available help. What do I or How do i?
You can also do 'nginx -s reload' which will reload your configurations and not take the site down by restarting nginx.
Great videos. Really enjoying them.
Good tip. THats a more "universal" way to do it. Where as the systemctl method doesn't work on every Unix OS.
Hi, you said that Let's Encrypt certificate is on goblockade.com. But what about www.goblockade.com? "curl -i www.goblockade.com" reports "curl: (51) SSL: no alternative certificate subject name matches target host name", Chrome automatically redirect to goblockade.com, Firefox returns a warning about unsecure connection (correct). How do you usually deal this case? Do you request another SSL certificate for www domain? I think this is an important point. Thank you
Thanks very much, worked nice, i tested CentOS Linux release 7.7.1908 (Core) and nginx version: nginx/1.16.1.
Hit the 100th like, great detailed tutorial, keep making tutorial on nginx, there are not many of them on youtube. Peace.
Awesome explanation, very simple and clear and yet very helpful and not confusing. Good job
Saved my day dude. Thanks
thx bro for explain, I have a little question about that. if i doing that. is good for seo ?
Exactly what I was looking for. Thanks man
File doesn't exist ....
You`re on fire lately!
Haha thanks.
https enabled and redirecting my http to https but without any greenlock pad
what should I do
thank you very much
This is great dude. Awesome.
how to convert http to https in hpux
how to redirect 301 from one domain to another even each post to another post, both hosted on digital ocean with serverpilot.. please send link if video is available..
what font are you using for your terminal?
Hey, your videos are very thoughtful and awesome. Do a video on sub domain routing both in development and production, thanks!
Seconded.
Though I'm pretty sure you can route *.example.com via an C-NAME record to your web app, and in Laravel use Route::domain() to detect and group together subdomain routes.
laravel.com/docs/5.5/routing#route-group-sub-domain-routing
A detailed explanation would be better
Yes that is the basic premise of how you do it. One feature that sucks about Laravel is that you have to hardcode the domain. THis is what makes it confusing for most people. However I have heard rumors that this might be fixed in Laravel 5.6. (cross your fingers).
Hi How can i map url in Nginx? for example I want to map the ClouderaManager IP(192.168.0.xx:7180) and port number to Nginx server, How can I do that? can you explain me please.
thanks bro..
Muchas gracias. Me sirvió demasiado.
Great! Nice Tutorial.
ww program BP picture
Very nice video thanks
Good video!
Come back Alex!!
thank you for the video, but how does that happen on your domain hosting? just wondering, does it take any extra configuration on the domain hosting ? thanks!
Sorry I was trying to show it best I could, but I didnt want to reveal all of my domains and their associated IP addresses.
So what you need to do is make an A record that points to the same IP address or server that your Nginx server is on. So in my case, my primary domain is the non-www version. So in order for Nginx to route the www traffic to the non-www you need to make sure the traffic actually gets to the server first. If you don't set up an A record in your DNS then the person who types in your www domain will never reach the server for Nginx to do its magic, because the DNS won't know to pass the traffic off to your server (the user will get a generic browser generated error).
Now some DNS providers (any respectable one) allow you to wildcard any subdomain (www is a subdomain) to the same server. That is an option too. I personally don't like wildcarded subdomains unless its a SAAS product that needs them all of the subdomains routed to the server, so I opt to only route the subdomains I want.
But to answer your question about what is happening at the domain hosting, I was simply creating an A record for the www subdomain. I sent all for that subdomain to the same server that hosts the non-www version. Once that is set up then the traffic will go to the nginx server and then nginx will route it to the secure port of the non-www version.
Thank you so much that you toke the time to answer my question, that means a lot to me. you are the best :)
I would be grateful if you could make a video about using & generating dynamic sub-domains with laravel :)
Good idea, ill add it to the list for future video ideas.
Thanks man
This didn't solve my problem, so hopefully my solution will help others:
1. Go to EC2 panel, and click on Load Balancer tab, and then on your load balancer;
2. Make sure you have 2 listeners: one for HTTP and one for HTTPS (otherwise create those);
3. Edit the rules for each one of them, adding a new rules for each that specifies your (www)(dot)(dot)com to go to port 443 and to be redirected to (dot)com;
4. Having the rules for both HTTP and HTTPS to be redirected to 443 with no "WWW" will be working immediately after that.
Hopefully this helped.
PS 1: I didn't have sites-available folder in my nginx for my Elastic Beanstalk app EC2. Apart from that, the steps I am saying are much more safer and easier to do.
PS 2: Modifications in the EC2 will not be persisted as well since Elastic Beanstalk can instantiate new ones for your app, so keep this in mind.
i am so confused if nginx? load balancers? or route53 cname?
Perfect!
I had 4 courses relating just plain web development, absolutley noone on the whole univeristy wanted to show me how to do this
Do not have redirect www.domain.com to domain.com
Why not?
why does it appear in chinese on google search ?
What is chinese?
chinese characters : en.wikipedia.org/wiki/Chinese_characters
Thx alex
I can see the nginx version you have installed...
Is that bad?
If there a security issue with a specific version, could be... to fix that, in the nginx.conf file, search for "server_tokens off" entry and uncomment it.. that's it
I bring you blessings from my LORD JESUS CHRIST WHO Is coming again to judge the living and the dead. Please give your life to HIM
Man, you're the best!