Tag Archives: nginx

make[1]: *** [objs/Makefile:445: objs/src/core/ngx_murmurhash.o] Error

An error is reported after making

make[1]: *** [objs/Makefile:445: objs/src/core/ngx_murmurhash.o] Error 1
make[1]: Leaving directory '/app/nginx-1.9.9'
make: *** [Makefile:8: build] Error 2

Solution
find the corresponding maakefile file (mine is in/nginx/objs/makefile), remove the - error in the GCC parameter, and then make again

error reason
after checking the meaning of – werrori, it turns out that it requires GCC to treat all warnings as errors, and all resulting errors cannot be output to the next step

Related exception: Ubuntu 18.04 compiles nginx and reports an error objs/makefile: 440: recipe for target ‘objs/SRC/core/NGX_ murmurhash.o’ failed

Error occurs when configuring nginx installation information. / configure: error: the HTTP rewrite module requires the PCRE library. You can

An error occurred during:

Linux terminal running nginx configuration information: (after running, it is found that the last line needs to be modified)

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/fastdfs/fastdfs-nginx-module-1.22/src

Therefore, after modifying the last line and running again, the contents shown in the error report appear

(modify last line)

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/software/fastdfs/fastdfs-nginx-module-1.22/src

Specific error reporting:

  Text content of error report:

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

Error content analysis:

The reason is that the PCRE package is not installed and you are not allowed to rewrite the previously configured content,

terms of settlement:

Run the following installation commands in Linux:

yum -y install pcre-devel

  After installation, run your modified configuration information again

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--add-module=/usr/local/software/fastdfs/fastdfs-nginx-module-1.22/src

what you think?

ginseng https://www.cnblogs.com/tudou1179006580/p/14875457.html

ginseng https://blog.csdn.net/yuntiank/article/details/8548147?locationNum=12

ginseng https://www.huaweicloud.com/articles/13235540.html

[Solved] Error during installation of nginx: Make: * * * [build] error 2

Run command:
sudo ./configure –prefix=/etc/ngin –with-http_ssl_module –with-openssl=/usr/bin/openssl –with-openssl=/usr/local/openssl-1.0.1t/

executable

root@ubuntuserver4:/usr/local/nginx-1.11.3# sudo make
make -f objs/Makefile
make[1]: Entering directory `/usr/local/nginx-1.11.3'
cd /usr/local/openssl-1.0.1t/ \
        && if [ -f Makefile ]; then make clean; fi \
        && ./config --prefix=/usr/local/openssl-1.0.1t//.openssl no-shared  \
        && make \
        && make install_sw LIBDIR=lib
/bin/sh: 1: cd: can't cd to /usr/local/openssl-1.0.1t/
make[1]: *** [/usr/local/openssl-1.0.1t//.openssl/include/openssl/ssl.h] Error 2
make[1]: Leaving directory `/usr/local/nginx-1.11.3'
make: *** [build] Error 2

Found a missing openssl-1.0.1t
Get it and re-run sudo . /configure –prefix=/etc/nginx –with-http_ssl_module –with-openssl=/usr/bin/openssl –with-openssl=/usr/local/openssl-1.0.1t/ and you’re done!

Nginx Startup Error: Job for nginx.service failed because the control process exited with error code

When we use systemctl     restart   When the nginx command restarts the service, an error is found as follows:

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

First, we can use systemctl     status   nginx   View current nginx status

systemctl status nginx
● nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2021-08-06 15:04:33 CST; 4min 10s ago
     Docs: http://nginx.org/en/docs/
  Process: 2099 ExecStop=/bin/sh -c /bin/kill -s TERM $(/bin/cat /var/run/nginx.pid) (code=exited, status=0/SUCCESS)
  Process: 2131 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
 Main PID: 1498 (code=exited, status=0/SUCCESS)

Aug 06 15:04:33 localhost.localdomain systemd[1]: Starting nginx - high performance web s.....
Aug 06 15:04:33 localhost.localdomain nginx[2131]: nginx: [warn] the "ssl" directive is d...:5
Aug 06 15:04:33 localhost.localdomain nginx[2131]: nginx: [emerg] cannot load certificate...e)
Aug 06 15:04:33 localhost.localdomain systemd[1]: nginx.service: control process exited, ...=1
Aug 06 15:04:33 localhost.localdomain systemd[1]: Failed to start nginx - high performanc...r.
Aug 06 15:04:33 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
Aug 06 15:04:33 localhost.localdomain systemd[1]: nginx.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

The first method: we find that the port is occupied, and use the command to view the process of the occupied port: netstat – anltp |  grep   eighty

View the occupied process number   Then kill   – nine   Process number   Restart after killing the process

The second method: we may have configuration errors when modifying the/etc/nginx/conf.d/default.conf or/etc/nginx/nginx.conf file. Recheck the editing. If we really can’t find the error, we can enter the error log of nginx to check: Tail – F/var/log/nginx/error.log     Specific modifications can be made according to the error file of nginx

Gitlab nginx wont start to work. [down: nginx: 1s, normally up, want up; run: log: (pid 20128)xxx]

conclusion
I got this problem as well. and now I’ve solved it.
solution
I’ve modified the /etc/gitlab/gitlab.rb file, changed into
nginx[‘redirect_http_to_https_port’] = 80
nginx[‘listen_port’] = 443
and sudo gitlab-ctl reconfigure + sudo gitlab-ctl restart, and it works.
process
in the past, the reason i could connect to gitlab server is because that my colleague have set something in the /var/opt/gitlab/nginx/conf/gitlab-http.conf file.

Redirects all HTTP traffic to the HTTPS host
server {
  listen *:80;

  server_name gitlab.xxxxx.com;
  server_tokens off; ## Don't show the nginx version number, a security best practice


  location/{
    return 301 https://gitlab.xxxxxx.com:443$request_uri;
  }

  # health checks configuration
  include /var/opt/gitlab/nginx/conf/gitlab-health.conf;

  access_log  /var/log/gitlab/nginx/gitlab_access.log gitlab_access;
  error_log   /var/log/gitlab/nginx/gitlab_error.log;
}

server {
  listen *:443 ssl http2;


  server_name gitlab.xxxxxx.com;
  server_tokens off; ## Don't show the nginx version number, a security best practice

and once if I’ve use the command sudo gitlab-ctl reconfigure, and the file gitlab-http.conf would be covered by /etc/gitlab/gitlab.rb. and the nginx settings in /etc/gitlab/gitlab.rb would start to take position that makes me cannot visit gitlab server after using the command sudo gitlab-ctl reconfigure. and now I’ve set the nginx settings right in /etc/gitlab/gitlab.rb just like in the solution part. hope it could help. thx.

The request was rejected because the URL contained a potentially malicious String “//“

Problem description

After the introduction of spring security, there is no problem using Vue proxy locally. There is a problem using nginx. The problem is located in the nginx configuration

Solution:

# rewrite ^(/api/?.*)$ /$1 break;  // old
 rewrite ^/api/(.*)$ /$1 break;    // modified

Explanation
take blog.lhuakai.top/api/getxxx as an example

nginx found /API , replaced the match to /api.getxxx/ with $1 (the content in the first group) getxxx and finally became blog.lhuakai.top/getxxx

How to Fix No default.conf file in conf.d after Installing Nginx

In the process of learning nginx, the default.conf file in the conf.d directory cannot be found after installing nginx. The reason is that the EPEL source under the operating system is downloaded by default, which is the Fedora operating system

Scheme I

resolvent

Reinstall nginx and modify the EPEL image source address of nginx

Reinstall

sudo yum install yum-utils

Create a new nginx.repo file

sudo vim /etc/yum.repos.d/nginx.repo

add to

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

By default, a stable repository of nginx packages is used. If you want to use the mainline nginx package, run the following command:

sudo yum-config-manager --enable nginx-mainline

Installing nginx

sudo yum install nginx

This is the information I found on the Internet. I see that many people have handled this problem according to this scheme, but like me, there is still no default.conf file under scheme 1 conf.d, so you can try the second method.

Scheme II

Because the default.conf itself is a configuration file, my idea is to directly create one since there is no one, and see if it works. So I created an empty file with VI default.conf, and then found the contents of the default.conf file on the Internet and put it in.

server {
    listen       80;
    server_name  localhost;


    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location /mystatus {
        stub_status;
    }

    location/{
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }


    #error_page  404              /404.html;


    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  404 /50x.html;//Modify the 404 status code of the corresponding pointed to the access directory, and restart the server after modification.
    location = /50x.html {
        root   /usr/share/nginx/html;
    }


    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}


    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}


    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

Finally, we changed the configuration according to the project requirements we deployed. Let’s also start nginx to have a look. We can see that there is no error after starting nginx, and we can also see the process of nginx, which shows that this method is feasible and simpler than scheme 1.

Solutions for faithfully yours, nginx

Today, as always, I opened the web page. At first, there was nothing wrong with it, and then it suddenly appeared:

An error occurred.

Sorry, the page you are looking for is currently unavailable.
Please try again later.

If you are the system administrator of this resource then you should check the error log for details.
Faithfully yours, nginx.

Is it a familiar mistake?

Check out the error page of nginx.

This 50x. Html is found to be the error on the web page.

Then check the port
through the command: netstat – tnlp to view the opened TCP port.
Found that the 9000 port PHP is not on.
Then restart the PHP service, and the problem is solved.

Nginx reverse proxy report 400 error solution!

upstream tomcat_ server { 
        server localhost:8090;
    }

server {
     listen 80;
     server_ name localhost;
    charset utf-8;
    access_ log logs/ host.access.log main;

location / {
    proxy_ pass http://tomcat_ server
    proxy_ set_ header Host $http_ Host; / / to add a host header here, return the header information to the server
}

Implementation of HTTPS file server based on nginx in win2012

Nginx and openssl: http://nginx.org/en/download.html

http://slproweb.com/products/Win32OpenSSL.html
Environment variable:
c:\ openssl-win64 \bin
th variable add %OPENSSL_HOME%

openssl genrsa -des3 -out xxx.key 1024
openssl req -new -key xxx.key -out xxx.csr
cp xxx.key xxx.key.org
openssl rsa -in xxx.key.org -out xxx.key
openssl x509 -req -days 365 -in xxx.csr -signkey xxx.key -out xxx.crt

Start nginx after modifying nginx.conf

server {
        listen       443 ssl;
        server_name  localhost;
		ssl_certificate      C://nginx-1.18.0//ssl//xxx.crt;
	    ssl_certificate_key  C://nginx-1.18.0//ssl//xxx.key;
        
		#charset koi8-r;

        #access_log  logs/host.access.log  main;

	    ssl_session_cache    shared:SSL:1m;
	    ssl_session_timeout  5m;
	
	    ssl_ciphers  HIGH:!aNULL:!MD5;
	    ssl_prefer_server_ciphers  on;

     location /update {
	        alias C:/hy-8000;
			allow all;
			autoindex on;

	        proxy_set_header   X-Real-IP            $remote_addr;
	        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
	        proxy_set_header   Host                   $http_host;
	        proxy_set_header   X-NginX-Proxy    true;
	        proxy_set_header   Connection "";
	        proxy_http_version 1.1;
     }

Nginx modifies the front end request size limit (413 request entity too large)

During use of NGINX, if the request message is too large in the front-end POST request, it is usually necessary to increase the value of the client_max_body_size property, which defaults to 1M. Avoid 413 Request Entity Too Large.
You can optionally set it in HTTP {} : client_max_body_size 20m; Controls all requests received by NGINX
You can also optionally set it in Server {} : client_max_body_size 20m; Controls the requests received within the server
You can also optionally set client_max_body_size 20m in Location {}; Controls the request that matches the routing rules of Location

Apple computer download file automatically with suffix problem solving

# download files automatically to avoid apple computer with suffix
discovered an interesting document, download a plain text file will not win with suffix, but MAC download will take a suffix, and asked for direct download, file download time cannot be browser opens, as shown in figure:

in the figure, found that under the MAC apple is, according to official provided in the download file but the download your configuration file is plain text document.
default_type application/json;
;
add_header content-disposition attachment
add_header content-disposition attachment
add_header content-disposition attachment
add_header content-disposition attachment
add_header content-disposition attachment
add_header content-disposition attachment
add_header Content-Type application/octet-stream;
and default_type is not configured. This allows Mac to download files directly without suffixes.