Drupal 7 login does not work on NGINX after enabling SSL with Letsencrypt

January 21, 2016 1.3k views
Let's Encrypt Nginx

I followed the excellent tutorial and the SSL cert verifies as valid. However the Drupal login to access the admin no longer activates and the page just reloads to itself. I enabled debug for the NGINX logs and below are the results. It ends with:

**recv() not ready (11: Resource temporarily unavailable). **

What's odd is our dev Drupal site works just fine. When I compare the logs the only difference is that this appears in the dev site:

***4 http request line: "POST /user HTTP/1.1"**

Below are the verbose debug logs. Any suggestions?

2016/01/21 11:38:56 [debug] 12534#0: *6467 write new buf t:1 f:0 00000000025F8510, pos 00000000025F8510, size: 239 file: 0, size: 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 http write filter: l:0 f:0 s:239
2016/01/21 11:38:56 [debug] 12534#0: *6467 http output filter "/node/add/page?render=overlay"
2016/01/21 11:38:56 [debug] 12534#0: *6467 http copy filter: "/node/add/page?render=overlay"
2016/01/21 11:38:56 [debug] 12534#0: *6467 image filter
2016/01/21 11:38:56 [debug] 12534#0: *6467 xslt filter body
2016/01/21 11:38:56 [debug] 12534#0: *6467 http postpone filter "/node/add/page?render=overlay" 00000000025F8670
2016/01/21 11:38:56 [debug] 12534#0: *6467 write old buf t:1 f:0 00000000025F8510, pos 00000000025F8510, size: 239 file: 0, size: 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 write new buf t:0 f:0 0000000000000000, pos 00000000006C6460, size: 132 file: 0, size: 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 write new buf t:0 f:0 0000000000000000, pos 00000000006C6740, size: 61 file: 0, size: 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 http write filter: l:1 f:0 s:432
2016/01/21 11:38:56 [debug] 12534#0: *6467 http write filter limit 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 writev: 432
2016/01/21 11:38:56 [debug] 12534#0: *6467 http write filter 0000000000000000
2016/01/21 11:38:56 [debug] 12534#0: *6467 http copy filter: 0 "/node/add/page?render=overlay"
2016/01/21 11:38:56 [debug] 12534#0: *6467 http finalize request: 0, "/node/add/page?render=overlay" a:1, c:1
2016/01/21 11:38:56 [debug] 12534#0: *6467 set http keepalive handler
2016/01/21 11:38:56 [debug] 12534#0: *6467 http close request
2016/01/21 11:38:56 [debug] 12534#0: *6467 http log handler
2016/01/21 11:38:56 [debug] 12534#0: *6467 free: 00000000025F76A0, unused: 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 free: 00000000025E6CC0, unused: 2666
2016/01/21 11:38:56 [debug] 12534#0: *6467 free: 000000000263C350
2016/01/21 11:38:56 [debug] 12534#0: *6467 hc free: 0000000000000000 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 hc busy: 0000000000000000 0
2016/01/21 11:38:56 [debug] 12534#0: *6467 tcp_nodelay
2016/01/21 11:38:56 [debug] 12534#0: *6467 reusable connection: 1
2016/01/21 11:38:56 [debug] 12534#0: *6467 event timer add: 5: 65000:1453394401016
2016/01/21 11:38:56 [debug] 12534#0: *6467 post event 0000000002681950
2016/01/21 11:38:56 [debug] 12534#0: *6467 delete posted event 0000000002681950
2016/01/21 11:38:56 [debug] 12534#0: *6467 http keepalive handler
2016/01/21 11:38:56 [debug] 12534#0: *6467 malloc: 000000000263C350:1024
2016/01/21 11:38:56 [debug] 12534#0: *6467 recv: fd:5 -1 of 1024
2016/01/21 11:38:56 [debug] 12534#0: *6467 recv() not ready (11: Resource temporarily unavailable)
2016/01/21 11:38:56 [debug] 12534#0: *6467 free: 000000000263C350

2016/01/21 11:39:10 [debug] 12534#0: *6442 event timer del: 3: 1453394350048
2016/01/21 11:39:10 [debug] 12534#0: *6442 http keepalive handler
2016/01/21 11:39:10 [debug] 12534#0: *6442 close http connection: 3
2016/01/21 11:39:10 [debug] 12534#0: *6442 reusable connection: 0
2016/01/21 11:39:10 [debug] 12534#0: *6442 free: 0000000000000000
2016/01/21 11:39:10 [debug] 12534#0: *6442 free: 00000000025E12D0, unused: 0
2016/01/21 11:39:10 [debug] 12534#0: *6442 free: 000000000263DDA0, unused: 128
1 Answer

It would be great to know some more details about your Nginx and Drupal configurations. For what it's worth, I was able to successfully configure SSL on a Drupal 8 site following the same Let's Encrypt tutorial.

One thing to check on with Drupal 7 is the value of the $conf['https'] setting in your sites/default/settings.php file. The Let's Encrypt tutorial sets up a redirect from HTTP to HTTPS. Counterintuitively, for $conf['https'] HTTPS-only sites the should be set to FALSE I'd also check to make sure that any plugins you might have do not need any special configuration for working with SSL.

For more information on configuring HTTPS for Drupal, check out this article in their knowledge base.

Have another answer? Share your knowledge.