[OT] Nginx config second look

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Could someone with nginx experience take a look at my config and tell me if it works?  I can't really test it in-house so I'm hoping someone has done something similar.  

Right now, I have two server blocks:

One to redirect example.com to www.example.com
server {
listen 443;
server_name example.com;
return 301 https://www.example.com$request_uri;
}

And another as the default server (for www.example.com)
server {
listen 443 default_server ssl;
}

I would really like to collapse that into one server block, something like this:
server {
listen 443 ssl; 
server_name example.com;
return 301 https://www.example.com$request_uri;
}

Is this the proper way to do this?  Or should I just stick with the way I have it now? This is a working, production configuration, in case anyone is curious. I've googled articles that suggest this is the way to do it, but can't truly test it in-house.

Any thoughts would be appreciated.


--

Mark Haney ::: Senior Systems Engineer

VIF International Education
P.O. Box 3566 ::: Chapel Hill, N.C. 27515 ::: USA
919-265-5006 office

Global learning for all.
www.vifprogram.com
Find VIF on Facebook | Twitter | LinkedIn

Recognized as a ‘Best for the World’ B Corp!

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux