I am trying to redirect HTTPS www request to non-www but I can't get it to work. What line of code would I have to change to achieve the redirection?  server {     root /var/www/mydomain.com/html;     index index.html index.htm index.nginx-debian.html;      server_name mydomain.com www.mydomain.com;      #gZip stuff here...     #Certbot stuff here... }  server {     if ($host = www.mydomain.com) {         return 301 https://$host$request_uri;     } # managed by Certbot      if ($host = mydomain.com) {         return 301 https://$host$request_uri;     } # managed by Certbot      listen 80;     listen [::]:80;      server_name mydomain.com www.mydomain.com;     return 404; # managed by Certbot }
Hi this must be a basic question but I haven't seen an answer with cerbot considerations (if there are any considerations). How do I get https www to redirect to non-www instead of timing out?  The https www version of my site times out instead of redirecting to non-www, whereas all other versions (http and https non-www) work fine.  Preferably I would like to future proof so that I can renew the certs through certbot and not need to manually change the nginx config afterwards.  The nginx server config is shown below:  server {     listen 80 default_server;     listen [::]:80 default_server ipv6only=on;     server_name www.mydomain.com mydomain.com;      listen 443 ssl; # managed by Certbot     ssl_certificate &lt;path_to_cert&gt; # managed by Certbot     ssl_certificate_key &lt;path_to_key&gt;; # managed by Certbot     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot     ssl_dhparam &lt;path_to_this&gt;      if ($scheme != "https") {         return 301 https://$host$request_uri;     } # managed by Certbot }
How are unbalanced forces even possible, given Newton's 3rd law? A known identity of binomial coefficients is that $$ \sum_i\binom{m}{i}\binom{n}{j-i}=\binom{m+n}{j}. $$ Is there a combinatorial proof/explanation of why it holds? Thanks. Connected compact covering space of torus is homeomorphic to $S^1\times S^1$ overbrace/underbrace but with an arrow instead Is there a similar command to \overbrace{foo}^{bar} but instead of braces, an arrow pointing up/down?  EDIT: Here's a little demonstration of how I'd expect something like this to work:    And possible syntax would be \overarrow{a=b}^{\text{theorem X}} In the early days of C++ when it was bolted on top of C, you could not use NULL as it was defined as (void*)0. You could not assign NULL to any pointer other than void*, which made it kind of useless. Back in those days, it was accepted that you used 0 (zero) for null pointers.  To this day, I have continued to use zero as a null pointer but those around me insist on using NULL. I personally do not see any benefit to giving a name (NULL) to an existing value - and since I also like to test pointers as truth values:  if (p &amp;&amp; !q)   do_something();   then using zero makes more sense (as in if you use NULL, you cannot logically use p &amp;&amp; !q - you need to explicitly compare against NULL, unless you assume NULL is zero, in which case why use NULL).  Is there any objective reason to prefer zero over NULL (or vice versa), or is all just personal preference?  Edit: I should add (and meant to originally say) that with RAII and exceptions, I rarely use zero/NULL pointers, but sometimes you do need them still. Meaning of telegraph code in the song "Planetes" The song Planetes in Guilty Crown begins with some telegraph encoding, which I think is . Here is the . My transcription is: -•-• -••-- •-- --•-- •- --•-• •-•-- -•--•  which decodes to this:  ni-yu-ya a-i-shi-te-ru  Niyuya didn't make sense. Did I get something wrong? A problem about an $R$-module that is both injective and projective. Let $R$ be a domain that is not a field, and let $M$ be an $R$-module that is both injective and projective. Prove that $M= \left \{ 0 \right \}$.   This is exercise 7.52 of Rotman's Advanced Modern Algebra. Using theorems before exercises, because $M$ is injective and $R$ is a domain, I conclude that $$\forall m\in M ,\forall r\in R\ (r\neq 0) ,\exists {m}'\in M \Rightarrow m=r{m}'$$ and also because $M$ is projective there is a surjective $\psi$ from free $R$-module $F$ with basis $\left \{ e_{i} \right \}_{i\in I}$ to $M$ and thus we can conclude that for every $m\in M$ we have $$m=\sum r_{i}\Psi (e_{i})$$ now I don't know how should I use these together.  The idea of what is happening or a suggestion or a hint will be great. Why is it wrong to serial voteup someone you like his answers?  Sometimes I just came to stackoverflow to read certain people answers(there are 4 guys currently) I have their profile bookmarked in my browser and in my free time at office I go to their profile and read their answers and learn a lot from them, but because I'm afraid to be a serial voter, I dont voteup them.   I think there is nothing wrong with that, if there is, please let me know. derivative bounded by a constant multiple of the function $f$ is differentiable on $[a,b]$, $f&#39;(x) \leq A|f(x)|$ where $A$ is a non-negative constant.  If $f(a)=0$ show $f(x)=0, \forall x\in [a,b]$  I imagine the proof uses the Mean Value Theorem but I have not been able to get it to work.  I know $|f(x)|=|f&#39;(c)|(x-a)$ where $c \in [a,x]$, so $|f(x)| \leq A\  |f(c)|(x-a)$ where $c\leq x$ And I guess I could sort of iterate this to keep getting a smaller $c$ but I don't see why it must go all the way to zero. Proof of "Dual normed vector space is complete" While trying to create a custom business rule using Apex I got the error:  INVALID_ID_FIELD, SaveAsActivity is not allowed with whatId that is not supported as a task whatId.  ...and found out that it was caused by the method setSaveAsActivity on my code, that was like:  msg.setSaveAsActivity(true); // "msg" is a SingleEmailMessage   What am I doing wrong here? What is the name of this Ubuntu program? A couple month ago I installed a bunch of clipboard manager programs in Ubuntu, tried them out and then removed them. I must have missed one of these and now it keeps bug me in my daily usage. I need some help to identify the name of this program because the program itself provides very limited information.  This clipboard program has below characteristics: 1. It occupies hotkey Ctrl+;. When I press this hotkey, the clipboard history will pop out. It happens in bash, Chrome, Eclipse IDE, and etc, wherever it is text inputable. This is kind of annoying because it overrides my other hotkeys inside these applications. 2. Very laconic UI. Like below picture, with only a line "Select to paste", then listing out the clipboard history. There is no program information whatsoever. Right clicking on it and no menu are shown at all.      So far I have tried below ways to identify this program: 1. Browse system monitor for processes with names that could be correlated. 2. Browse through my installation log (dpkg.log) to find my installation history. Without luck, the log is lost. But I was not successful. What does different focal length offer me? I read a book of this series probably around 2000. I think the series was quite new then but not sure.  The main thing I remember about it is that magic is based on words of power. If you knew one word you got some extra ability, knowing two words gave you yet some other ability, and if you knew three words you became a very powerful wizard. Only one person at a time could know each word, and telling someone your word meant you died.  The main protagonist somehow gets hold of one word and then for some reason strives to learn more.  EDIT: I think that I accidentally picked up the second book of the series and never read the first one. From what I remember, the protagonist learned one word of power and got some kind of supernatural ability (cannot remember what though). He then ends up in some kind of challenge where he has to cooperate with another person who knows another word that gives super-strength.  Not very coherent memories, but I hope someone knows what series it is. It has been bugging me for years. (Not even sure if the series is good at all, but still would like to know the name.)  EDIT2:  I remember the world as being medieval-ish. I do not think there were dragons, but there may have been other humanoid races (I have a very weak recollection that there may have been an orc or similar in the story, but this could be completely wrong). The protagonist was male. I'm writing an article on  and some people pointed out that this is completely useless.  My idea is to amend my article with some theories that seemed useless when they are created but found use after some time.  I came with some ideas like the Turing machine but I think I'm not grasping the right examples.  Can someone point me some theories that seemed like the Lychrel numbers and then become 'useful'? Previous questions confirmed that Hex can last through multiple encounters (assuming my warlock's concentration doesn't get broken by a club to the head or the like) and at higher levels even through a short rest.   My question is how targeting Hex works when trying to keep it up for extended periods of time.   Can I just cast it on nothing and keep it up until a valid target presents itself or is an initial valid target required?   Then later, does changing the target of the Hex require that the original target is brought to 0 HP?   Once the initial target dies does the spell stay active even if I don't immediately choose a new target?  My suspicion from reading the spell is that it needs an initial target, but then from that point on I can just keep it up after that target dies until it either expires or a new target presents itself. Is this correct? Every open set in $\mathbb{R}$ is a countable union of closed sets Some months ago I watched  video of Blenderguru about "How to create a realistic earth in blender". In this video blender render is used and  now that I understand texturing in cycles a little better I am trying to rebuild this "realistic earth" with cycles.    In the video - starting at about 11:30 min - it is shown how to map the "earth day" and "earth night" image textures. Depending on the lights shining on the earth the earth or night image is projected. I tried to rebuild that in cycles but I think I a making mistakes. In the circled box the "night" nodes are found. What Is my mistake ?   P.S When you see other mistakes in this node tree, please let me know.  OK ... I now have implemented the advice of Uncle Snail (except moving the black slider). Below an image of the earth and the updated node tree (I also rearranged nodes for better overview).    In the Color Ramp, I did not move the slider. Is that really necessary ?? Find the value of : $\cos x \cos 2x...\cos 999x$ given that $x=\frac {2\pi}{1999}$ Can't unhide objects