NGINX configuration

Hello,

I have a problem with the correct creation of a configuration file for NGINX so as to achieve the proper functioning of the bitcoin-abe system (https://github.com/bitcoin-abe/bitcoin-abe)
Ultimately, the written configuration for Apache2 with FastCGI looks as follows:

<VirtualHost *: 80>
    ServerName bitchain.pl
    Alias ​​/ static /home/ubuntu/bitcoin-abe/Abe/htdocs /
    Alias ​​/robots.txt home/ubuntu/bitcoin-abe/Abe/htdocs/robots.txt
    Alias ​​/favicon.ico home/ubuntu/bitcoin-abe/Abe/htdocs/favicon.ico
    Alias ​​/ /usr/lib/cgi-bin/abe.fcgi/

    # Raise this if you get server errors mentioning "mod_fcgid:
    # read data timeout in 40 seconds "
    #FcgidIOTimeout 40
    # Uncomment to log Abe requests.
    #ErrorLog /var/log/abe_error.log
    #LogLevel info
    #CustomLog /var/log/abe_access.log combined
</ VirtualHost>

I have found no working configa for nginx, and all attempts to create my own have failed - reaching in the best case “access denied (as an error on the abe system) [with the setting ** cgi.fix_pathinfo = 0 **], or” file not found "when set to ** cgi.fix_pathinfo = 1 **.
For the above Apache2 configuration, two files must be created for the operation:

1 - /usr/lib/abe.fcgi:

#!/usr/bin/python
import subprocess, sys, os
command = ["sudo", "-u", "ubuntu", "/home/ubuntu/cgi-bin/abe", str (os.getpid ())]
subprocess.Popen (command, stdin = sys.stdin) .wait ()

2 - /home/ubuntu/cgi-bin/abe:

#!/bin/sh
PYTHONUNBUFFERED=1
exec python -m Abe.abe --config /home/ubuntu/bitcoin-abe/abe.conf - static-path static / --watch-pid = "$1"

In the configuration for Apache2 specified in the first quotation, set the path compatible with the script information about the location where / htdocs is, which in my case looks like this:

/home/ubuntu/bitcoin-abe/Abe/htdocs

Would anyone be polite and spare me further (and so long lasting) suffering with this config and gave me properly configured values ​​to be placed in the file?

The above data contains file / folder paths compatible with those that apply to my server (ie username to ubuntu, etc.)
In the APACHE configuration example, I have already provided information that is accurate for my case.

So finally, here are the relevant paths and details:

htdocs: /home/ubuntu/bitcoin-abe/Abe/htdocs
abe.conf: /home/ubuntu/bitcoin-abe/abe.conf
domain address: bitchain.pl
nginx: /etc/nginx

… and the whole should be available to all who enter the address in the browser.

I gave proper chmod to the whole bitcoin-abe directory and the abe + abe.fcgi files, and the script after running ./abe starts entering data into the database, and therefore works correctly. The problem is only access to chaina on the web in any way using fcgi.

Thank you very much in advance!

alias directives are documented:
http://nginx.org/en/docs/http/ngx_http_core_module.html#alias
http://nginx.org/en/docs/http/ngx_http_core_module.html#location
http://nginx.org/en/docs/dirindex.html

fastcgi:
https://www.nginx.com/resources/wiki/start/topics/examples/fastcgiexample/

Seriously? Well, what will not you say. I love tips like “you need to contact support for this”. The variables from the last FastCGI link are from the machine originally uploaded before the nginx installation. All the rest is also uploaded at the beginning, and my post is a result of the fact that I CAN NOT make a whole from the data that I have painstakingly searched for many months without any success. Maybe someone can actually help me without unnecessary piercing? I do not intend to remember the rules necessary to create the perfect config for every occasion, but to run one - the above-described script using nginx, whose variables from the given links are already set.

Sponsor our Newsletter | Privacy Policy | Terms of Service