How can I block all bots from crawling my twitter link - twitter

When I post a url (my own custom url shortener) in a tweet I get a lot of crawlers/spiders crawling my page (see access log below).
I updated my robots.txt to recently:
#Code to not allow any search engines!
User-agent: *
Disallow: /
How can I block them from accessing my url. The problem is every time someone goes to my url I increment the view count and it is skewing my count up. Do you think perhaps I can look for these IP addresses and if one of them don't count them in my counts?
Access Log:
69.164.197.15 - - [21/Aug/2014:16:43:09 -0400] "GET /378 HTTP/1.1" 302 4 "http://api.twitter.com/1/statuses/show/502556534631854081.json" "InAGist URL Resolver (http://inagist.com)"
46.236.24.53 - - [21/Aug/2014:16:43:10 -0400] "GET /378 HTTP/1.1" 302 30 "-" "-"
107.22.95.116 - - [21/Aug/2014:16:43:10 -0400] "GET /378 HTTP/1.1" 302 4 "-" "help#dataminr.com"
50.18.102.132 - - [21/Aug/2014:16:43:11 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "Google-HTTP-Java-Client/1.17.0-rc (gzip)"
23.23.112.130 - - [21/Aug/2014:16:43:11 -0400] "GET /378 HTTP/1.1" 302 4 "-" "Java/1.7.0_25"
50.18.102.132 - - [21/Aug/2014:16:43:11 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "Google-HTTP-Java-Client/1.17.0-rc (gzip)"
38.88.172.134 - - [21/Aug/2014:16:43:12 -0400] "GET /user/ HTTP/1.1" 200 3880 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
38.88.172.134 - - [21/Aug/2014:16:43:13 -0400] "GET /user/%3C?php%20echo%20$config[ HTTP/1.1" 404 719 "http://awgo.to/user/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
65.52.244.38 - - [21/Aug/2014:16:43:22 -0400] "GET /378 HTTP/1.1" 302 30 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"
38.88.172.134 - - [21/Aug/2014:16:43:23 -0400] "GET /user/ HTTP/1.1" 200 3880 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
38.88.172.134 - - [21/Aug/2014:16:43:23 -0400] "GET /user/%3C?php%20echo%20$config[ HTTP/1.1" 404 719 "http://awgo.to/user/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
199.16.156.126 - - [21/Aug/2014:16:43:24 -0400] "GET /robots.txt HTTP/1.1" 200 82 "-" "Twitterbot/1.0"
37.59.16.161 - - [21/Aug/2014:16:43:28 -0400] "GET /378 HTTP/1.1" 302 30 "-" "Mozilla/5.0 (compatible; PaperLiBot/2.1; http://support.paper.li/entries/20023257-what-is-paper-li)"
38.88.172.134 - - [21/Aug/2014:16:43:31 -0400] "GET /user/ HTTP/1.1" 200 3883 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
38.88.172.134 - - [21/Aug/2014:16:43:32 -0400] "GET /user/%3C?php%20echo%20$config[ HTTP/1.1" 404 719 "http://awgo.to/user/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36"
107.155.73.2 - - [21/Aug/2014:16:43:33 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "MetaURI API/2.0 +metauri.com"
107.155.73.2 - - [21/Aug/2014:16:43:33 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "MetaURI API/2.0 +metauri.com"
199.16.156.126 - - [21/Aug/2014:16:43:45 -0400] "GET /robots.txt HTTP/1.1" 200 82 "-" "Twitterbot/1.0"
142.4.216.19 - - [21/Aug/2014:16:44:02 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "Mozilla/5.0 (compatible; OpenHoseBot/2.1; +http://www.openhose.org/bot.html)"
142.4.216.19 - - [21/Aug/2014:16:44:03 -0400] "GET /378 HTTP/1.1" 302 30 "-" "Mozilla/5.0 (compatible; OpenHoseBot/2.1; +http://www.openhose.org/bot.html)"
74.112.131.246 - - [21/Aug/2014:16:44:09 -0400] "GET /378 HTTP/1.1" 302 30 "-" "Mozilla/5.0 ()"
199.59.148.210 - - [21/Aug/2014:16:44:09 -0400] "GET /robots.txt HTTP/1.1" 200 82 "-" "Twitterbot/1.0"
38.88.172.134 - - [21/Aug/2014:16:44:27 -0400] "GET /admin/url HTTP/1.1" 200 3051 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36"
54.167.203.95 - - [21/Aug/2014:16:44:51 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9) Gecko/2008052906 Firefox/3.0"
199.59.148.209 - - [21/Aug/2014:16:45:36 -0400] "GET /robots.txt HTTP/1.1" 200 82 "-" "Twitterbot/1.0"
54.226.56.247 - - [21/Aug/2014:16:45:43 -0400] "GET /378 HTTP/1.1" 302 4 "http://awgo.to/378" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30"
109.68.166.70 - - [21/Aug/2014:16:45:49 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "-"
94.23.27.149 - - [21/Aug/2014:16:47:15 -0400] "GET /robots.txt HTTP/1.1" 200 82 "-" "Mozilla/5.0 (compatible; Kraken/0.1; http://linkfluence.net/; bot#linkfluence.net)"
54.237.153.130 - - [21/Aug/2014:16:47:16 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9) Gecko/2008052906 Firefox/3.0"
184.73.210.145 - - [21/Aug/2014:16:48:25 -0400] "GET /378 HTTP/1.1" 302 4 "-" "Python-urllib/2.7"
104.130.132.62 - - [21/Aug/2014:16:48:29 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "Jakarta Commons-HttpClient/3.0.1"
64.95.141.10 - - [21/Aug/2014:16:48:59 -0400] "GET /356 HTTP/1.1" 302 4 "-" "Java/1.7.0_51"
23.94.19.179 - - [21/Aug/2014:16:49:29 -0400] "GET / HTTP/1.0" 200 2588 "http://www.awgo.to/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31"
23.94.19.179 - - [21/Aug/2014:16:49:30 -0400] "POST /?url HTTP/1.1" 200 2664 "http://www.awgo.to/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31"
94.23.30.222 - - [21/Aug/2014:16:49:31 -0400] "GET /nEjjM HTTP/1.1" 302 4 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)"
94.23.30.222 - - [21/Aug/2014:16:49:31 -0400] "GET /KVDpK HTTP/1.1" 302 4 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)"
117.169.1.86 - - [21/Aug/2014:16:49:55 -0400] "GET /?lang=en HTTP/1.1" 200 2588 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31"
50.28.51.253 - - [21/Aug/2014:16:50:36 -0400] "HEAD /378 HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 5.1; rv:10.0.1) Gecko/20100101 Firefox/10.0.1"
189.166.175.145 - - [21/Aug/2014:16:50:46 -0400] "GET /378 HTTP/1.1" 302 30 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36"

Related

NginX reverse proxy (https:8443 to http:80) with multiple sites not working

Been working on this for a few nights and I can't seem to get it to work. This is on my home network where my ISP blocks incoming traffic to TCP-80 & 443 so, I have a couple of sites running on strange ports; don't be alarmed.
My current setup:
I have a Raspberry Pi that runs a couple of wikis via NginX. The sites are available to the outside world via a couple of subdomains (example: https://wiki.somedomain.com:8443/ & https://wiki2.somedomain.com:8443/) and I have a legit wildcard cert for *.somedomain.com. This was a pet project of mine and has been working in the current config for a few years.
Moving the Setup:
The Pi is getting a bit old and I've started playing around with Docker and got my sites moved to a couple of docker containers on a faster and more stable machine that run on TCP-80. Locally, I can hit those via IP and they run fine; they just don't have a cert. My goal was to set up a reverse proxy with my legit cert and have it redirect the traffic, coming in on https:8443 to http:80. As near as I can tell, this is the way of going about this type of setup where you have multiple Docker containers and don't have certs for all of them. If I'm misunderstanding something, stop me right here and tell me I'm wasting my time; the bang-head-here sign on the wall next to me will thank you.
NginX Config:
nginx -t says this config is fine but, clearly, something wrong. If it's logging an error, I don't know where; I've ran a few tail -f commands and found nothing being added. Neither Firefox nor Brave give me any meaningful errors, other than this site can't be reached, as near as I can tell. Any ideas? Am I wasting my time?
# SSL Info
ssl_certificate /etc/letsencrypt/live/cherryblossomfarmette.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cherryblossomfarmette.com/privkey.pem;
## Server Info
# IT Wiki
server {
#listen 80;
listen 8443 ssl;
server_name wiki.cherryblossomfarmette.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
location / {
proxy_pass http://192.168.100.35:8080;
}
}
Docker
Here's one of my docker compose files. The other docker compose file is the same except it listens on 8081.
docker run \
--detach \
--name=dokuwiki-it \
--env "TZ=America/New_York" \
--publish 8080:80 \
--volume "/home/tome/Docker/IT_Wiki/config:/config" \
--restart unless-stopped \
lscr.io/linuxserver/dokuwiki
Access.log - when configured for HTTP:80
When I comment out listen 8443 ssl; and hit the site across the LAN, the site loads and I see records in access.log.
192.168.20.131 - - [19/Jan/2022:19:58:59 -0500] "GET / HTTP/1.1" 200 5250 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:19:58:59 -0500] "GET /lib/exe/taskrunner.php?id=start&1642640339 HTTP/1.1" 200 42 "http://192.168.20.102/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
Access.log - when configured for HTTPS:8443
When I comment out listen 80; and hit the site across the LAN, the site loads and I see records in access.log. Of course, I get the typical the SSL cert nag in the browser because I'm not coming through with the virtual host name like I use from outside the network.
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET / HTTP/1.1" 200 5250 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/tpl/dokuwiki/images/logo.png HTTP/1.1" 200 3744 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/exe/css.php?t=dokuwiki&tseed=b378c07b31317225e36675986970a553 HTTP/1.1" 200 39260 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/images/license/button/cc-by-sa.png HTTP/1.1" 200 379 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/tpl/dokuwiki/images/button-donate.gif HTTP/1.1" 200 187 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/tpl/dokuwiki/images/button-css.png HTTP/1.1" 200 297 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/tpl/dokuwiki/images/button-html5.png HTTP/1.1" 200 305 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/tpl/dokuwiki/images/button-dw.png HTTP/1.1" 200 398 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/tpl/dokuwiki/images/button-php.gif HTTP/1.1" 200 207 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/images/email.png HTTP/1.1" 200 370 "https://192.168.20.102:8443/lib/exe/css.php?t=dokuwiki&tseed=b378c07b31317225e36675986970a553" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/images/external-link.png HTTP/1.1" 200 431 "https://192.168.20.102:8443/lib/exe/css.php?t=dokuwiki&tseed=b378c07b31317225e36675986970a553" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/exe/taskrunner.php?id=start&1642640673 HTTP/1.1" 200 42 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"
192.168.20.131 - - [19/Jan/2022:20:04:34 -0500] "GET /lib/tpl/dokuwiki/images/favicon.ico HTTP/1.1" 200 7406 "https://192.168.20.102:8443/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"

nextcloud installed with docker shows Internal Server Error

Nextcloud and mariadb were installed through docker-compose using the nextcloud official image posted on the docker hub. At first it ran fine, but at some point I get the following error:
version: '2'
volumes:
nextcloud:
db:
services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=a1234!
- MYSQL_PASSWORD=a1234!
- MYSQL_DATABASE=taeil
- MYSQL_USER=taeil
app:
image: nextcloud
ports:
- 8080:80
links:
- db
volumes:
- nextcloud:/var/www/html
restart: always
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
Container log.
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
[Tue Feb 25 06:22:26.247273 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.15 configured -- resuming normal operations
[Tue Feb 25 06:22:26.247325 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
172.18.0.1 - - [25/Feb/2020:06:29:24 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:29:25 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:30:16 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:30:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:31:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:31:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:32:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:32:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:33:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:33:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:34:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:34:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:35:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:35:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:36:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:36:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:37:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:37:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:38:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:38:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:39:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:39:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:40:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:40:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:41:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:41:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:42:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:42:22 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:43:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:43:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:44:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:44:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:45:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:45:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:46:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:46:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:47:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:47:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:48:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:48:23 +0000] "-" 408 0 "-" "-"
172.18.0.1 - - [25/Feb/2020:06:48:34 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:34 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:35 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:35 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:35 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:35 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:36 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:36 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:36 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:36 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:36 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:36 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:37 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:48:37 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:17 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:26 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:26 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:26 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:26 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:26 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:27 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:28 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:28 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:28 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:28 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:28 +0000] "GET / HTTP/1.1" 500 503 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
172.18.0.1 - - [25/Feb/2020:06:49:28 +0000] "GET /favicon.ico HTTP/1.1" 500 503 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36"
Log written inside container.
root#658b066e61eb:/var/www/html/data# cat nextcloud.log
{"reqId":"bZA84C2ahOfIiE5TUmlb","level":2,"time":"2020-02-25T02:18:05+00:00","remoteAddr":"172.18.0.1","user":"--","app":"appstoreFetcher","method":"POST","url":"/index.php","message":"Could not connect to appstore: cURL error 28: Resolving timed out after 10000 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36","version":"18.0.1.3"}
{"reqId":"6bFnYDSahoUE6pPvElgg","level":2,"time":"2020-02-25T02:18:29+00:00","remoteAddr":"172.18.0.1","user":"keti","app":"appstoreFetcher","method":"GET","url":"/settings/apps/list","message":"Could not connect to appstore: cURL error 28: Resolving timed out after 10000 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36","version":"18.0.1.3"}
{"reqId":"6bFnYDSahoUE6pPvElgg","level":2,"time":"2020-02-25T02:18:39+00:00","remoteAddr":"172.18.0.1","user":"keti","app":"appstoreFetcher","method":"GET","url":"/settings/apps/list","message":"Could not connect to appstore: cURL error 28: Resolving timed out after 10000 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36","version":"18.0.1.3"}
Looking at the result of error 28, it is a timeout error and I don't know what is wrong.
I restarted docker with the systemctl command, deleted the docker image and the container and ran it again, but I keep getting the error.
How can I fix this error?
I hope you have resolved the issue already. However I faced recently with the same issue and found the solution.
The reason is that nextcloud moves on Alpine Linux. Their Alpine variant is not compatible with Raspberry Pi 4 devices in case of:
You are running a version of Docker prior to 19.04.
You are running an outdated libseccomp2 library.
If it's the case you should update incompatible parts. Docker update should not be tricky. The steps for libseccomp2 are also well documented, as this has been a problem on multiple platforms (not just RPI4). The provided link describes the way you could update them.
In my case image nextcloud:22 works well. I updated only libseccomp2 library and it was enough.
Please try to set resource quotas for your containers. It might be that your database is consuming too much of your overall resources. You can find information on how to set up memory quotas here
https://docs.docker.com/compose/compose-file/compose-file-v2/
https://docs.docker.com/compose/compose-file/

Containerization of a vue.js app with nginx runs into redirect loop

I am building a vue.js app which I want to serve using nginx. However, it fails with the error ERR_TOO_MANY_REDIRECTS.
In the beginning nginx tried to redirect to port 80 when the external port was 8000. That's why I added the line absolute_redirect off; to the config. However, this only caused a redirect loop:
172.17.0.1 - - [02/Jan/2019:15:24:24 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
172.17.0.1 - - [02/Jan/2019:15:24:24 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
172.17.0.1 - - [02/Jan/2019:15:24:24 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
172.17.0.1 - - [02/Jan/2019:15:24:24 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
172.17.0.1 - - [02/Jan/2019:15:24:24 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
172.17.0.1 - - [02/Jan/2019:15:24:24 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
172.17.0.1 - - [02/Jan/2019:15:24:24 +0000] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
Here's the /etc/nginx/nginx.conf file:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile off;
keepalive_timeout 60;
# gzip on;
include /etc/nginx/conf.d/*.conf;
}
And here is the website config:
server {
absolute_redirect off;
port_in_redirect off;
location / {
root /usr/share/nginx/html/;
try_files / /index.html;
}
}
What am I missing here?
try_files / /index.html;
This loops back to your location /, change it to try_files $uri $uri/ /index.html =404; should solve your problem

Deploy Ruby on Rails on Ubuntu 14.04 with Apache/Passenger

I'm trying to deploy my ruby on rails application on a DigitalOcean server. I am using Ubuntu 14.04 x64, Passenger 5.0.10 and Apache 2 to deploy. I followed this tutorial. When I try to run my application on production environment I get this error "We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly." I can run on development environment.
This are the Apache 2 access.log:
"GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 495 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 403 494 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 403 505 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 500 3339 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET / HTTP/1.1" 500 3339 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET / HTTP/1.1" 500 3339 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 500 3339 "http://kproxy.com/doproxy.jsp" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.8$
"GET / HTTP/1.1" 500 3339 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 500 3339 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 500 3339 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 500 3339 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 500 64889 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.$
"GET / HTTP/1.1" 500 66303 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36"
"GET /favicon.ico HTTP/1.1" 200 295 "http://45.55.92.193/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.
This are the Apache 2 error.log:
/usr/local/lib/ruby/gems/2.2.0/gems/devise-3.5.1/lib/devise/rails.rb:14:in `block in <class:Engine>'
/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:36:in `call'
/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/finisher.rb:55:in `block in <module:Finisher>'
/usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
/usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
/usr/local/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
/usr/local/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
/usr/local/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
/usr/local/lib/ruby/2.2.0/tsort.rb:345:in `each'
/usr/local/lib/ruby/2.2.0/tsort.rb:345:in `call'
/usr/local/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
/usr/local/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
/usr/local/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
/usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
/home/rails/App/newdvp/config/environment.rb:5:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/usr/local/lib/ruby/gems/2.2.0/gems/rack-1.6.1/lib/rack/builder.rb:55:in `instance_eval'
/usr/local/lib/ruby/gems/2.2.0/gems/rack-1.6.1/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.10/helper-scripts/rack-preloader.rb:107:in `eval'
/usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.10/helper-scripts/rack-preloader.rb:107:in `preload_app'
/usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.10/helper-scripts/rack-preloader.rb:153:in `<module:App>'
/usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.10/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.10/helper-scripts/rack-preloader.rb:28:in `<main>'
[ 2015-06-16 02:34:33.2422 9276/7f74f0b2e700
age/Hel/Req/CheckoutSession.cpp:252 ]: [Client 1-5]
Cannot checkout session because a spawning error occurred.
The identifier of the error is 74aaa4d4. Please see ear$
My database.yml:
development:
adapter: postgresql
encoding: unicode
database: dvp_development
pool: 5
username: rails
password:
host: localhost
test:
adapter: postgresql
encoding: unicode
database: dvp_development
pool: 5
username:
password:
production:
adapter: postgresql
encoding: unicode
database: dvp_development
pool: 5
username: rails
password:
host: localhost
You can add the following option to your apache virtual host :
PassengerFriendlyErrorPages on
It permits apache/passenger to display a friendly error page. Hope it will help.

Big delay while processing HTTP request from NGINX to Unicorn (AngularJS to Rails API) only in Chrome

I have an AngularJS front-end that sends requests to a Rails API back-end application. The AngularJS front-end is running in a NGINX server. The Rails API is running in an Unicorn server.
Generally, they are working fine together, but in one case. When I first load the home page most of the times (but not always) there is a big delay (around 12 seconds to process the request to Rails). I´m not sure, but my guess is this is only happening for the first request from Nginx to Unicorn.
This is a big issue for me, because when a user request the home page for first time, the page is loaded and displayed quite fast (it takes around 2 secs to display all components), however, the user has to wait around these 12 seconds, until the combo boxes are loaded with data coming from the backend.
I have no idea about server configuration. I´m just a developer. I tried to debug the request and try to figure out where the bottleneck is, but I don´t find anything.
Please, find my NGINX access.log logs:
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/bootstrap.min.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/bootstrap-responsive.min.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /dist/css/yanpy.min.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/icons.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/menus.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/join-us.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/font-awesome.min.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/font-awesome-ie7.min.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /dist/css/yanpy-ext-1.min.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /css/lightbox.css HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /dist/js/yanpy-libs-1.min.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /js/app.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /js/services.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /js/controllers.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /dist/js/yanpy.min.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /js/filters.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /js/directives.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /js/i18n.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /js/properties/properties.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /dist/js/yanpy-libs-2.min.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:45 +0100] "GET /img/logo.png HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /languages/locale-en.json HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /lib/angular/i18n/angular-locale_en.js HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /languages/locale-en.json HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /partials/login.html HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/glyphicons-halflings.png HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /partials/home.html HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/facilImage.png HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/rapidoImage.png HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/seguroImage.png HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/carrusel1.jpg HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/carrusel2.jpg HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/carrusel3.jpg HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /img/carrusel4.jpg HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:46 +0100] "GET /partials/boat-searcher.html HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
127.0.0.1 - - [12/Nov/2014:19:33:47 +0100] "GET /img/glyphicons-halflings-white.png HTTP/1.1" 304 0 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36"
As you can see it takes around 2 seconds. This point I don´t know why I can´t see the request to the Rails API in this file (anyway, you can see them in the snapshot I attach).
After this log, I´m just waiting for 12 seconds for the rails api request:
Started GET "/getTranslationLanguages" for 127.0.0.1 at 2014-11-12 19:33:59 +0100
Processing by LanguagesController#translationLanguages as HTML
Language Load (0.4ms) SELECT `languages`.* FROM `languages` WHERE `languages`.`translation` = 1
Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.4ms)
Started GET "/currencies" for 127.0.0.1 at 2014-11-12 19:33:59 +0100
Processing by CurrenciesController#index as HTML
Currency Load (0.3ms) SELECT `currencies`.* FROM `currencies`
Completed 200 OK in 3ms (Views: 1.8ms | ActiveRecord: 0.3ms)
Started GET "/boat_people" for 127.0.0.1 at 2014-11-12 19:33:59 +0100
Processing by BoatPeopleController#index as HTML
BoatPerson Load (0.3ms) SELECT `boat_people`.* FROM `boat_people`
Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.3ms)
Started GET "/getTranslationLanguages" for 127.0.0.1 at 2014-11-12 19:33:59 +0100
Processing by LanguagesController#translationLanguages as HTML
Language Load (0.4ms) SELECT `languages`.* FROM `languages` WHERE `languages`.`translation` = 1
Completed 200 OK in 2ms (Views: 1.0ms | ActiveRecord: 0.4ms)
Started GET "/currencies" for 127.0.0.1 at 2014-11-12 19:33:59 +0100
Processing by CurrenciesController#index as HTML
Currency Load (0.3ms) SELECT `currencies`.* FROM `currencies`
Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.3ms)
See, there is a delay of 12 seconds from the last log entry in Nginx to first log entry in Unicorn.
I don´t know what happens while this time.
I also attach a snapshot from Google tools. It displays more or less same info that the Nginx access.log. But this time, you can see the requests to Rails API (i.e. getTranslationLanguages) that has a latency of 12.40 secs.
Why is it waiting for that 12 seconds? Could be any cache? What else can I check?
UPDATE: I don´t know why it seems to be related to cache or cookies. When I delete browsing history with cache and cookies in my browser and I load the site the issue doesn´t happen anymore. After that, if I just refresh the page, the issue happens.
IMPORTANT UPDATE Now, I´m pretty sure the issue is located in Unicorn. If I just shutdown Unicorn and startup webrick (without any other update on my application or code) the issue doens´t happen anymore.
I attach my Unicorn.rb config file:
# config/unicorn.rb
if ENV["RAILS_ENV"] == "development"
worker_processes 1
stderr_path "/Users/Rober/Projects/yanpy/dev/yanpyapi/log/unicorn.stderr.log"
stdout_path "/Users/Rober/Projects/yanpy/dev/yanpyapi/log/unicorn.stdout.log"
elsif ENV["RAILS_ENV"] == "test"
worker_processes 1
stderr_path "/home/ubuntu/env/test/www/yanpyapi-test/log/unicorn.stderr.log"
stdout_path "/home/ubuntu/env/test/www/yanpyapi-test/log/unicorn.stdout.log"
listen 8081
else
#worker_processes 3
worker_processes 1
stderr_path "/home/ubuntu/env/production/www/yanpyapi/log/unicorn.stderr.log"
stdout_path "/home/ubuntu/env/production/www/yanpyapi/log/unicorn.stdout.log"
end
timeout 30
Note: You don´t have to worry about the environment, the issue is happening in both of them.
UPDATE: When I send request in my browser directly to a Rails endpoint in Unicorn i.e http://localhost:8080/getTranslationLanguages I got the result immediately in my browser in json format. I mean, the issue doesn´t happen. So, it looks like the issue is only when the request are sent from Nginx to Unicorn.
IMPORTANT UPDATE I have confirmed the issue is only happening with Google Chrome. It never happens with Safari. Even, I have noticed, when I run audit tool in Google tools, it somehow clean everything, so everytime I run the audit it works perfectly.
UPDATE: I have installed and tested with Puma. It´s working. I don´t know why the combination of Unicorn and Chrome is not working.

Resources