nginx not running that displays 404 message - nginx

I've been following the directions based on http://linoxide.com/linux-how-to/install-configure-femp-stack/
So far when I ran my ip address http://ip address
I got an error that says "404 not found."
I've already enable sysrc nginx_enable=yes and that one works
Next I tried nginx -t and that part works and it says:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Then I tried nginx result and it it didn't work and I got the message saying "invalid option: "result"" it didn't work then I tried service nginx start and
it start running and when I type my ip address I kept getting 404 message.

Related

.NET Core WebAPI - AWS ElasticBeanstalk Nginx Configuration

I've moved my .NET Core WebAPI to an AWS EB Instance. This works fine, however my file upload has now broken due to the Nginx 'client_max_body_size' configuration.
I've looked up how to override this, however I cannot get this to work. Here is my current set-up:
Within this file I have added:
client_max_body_size 0;
This file has no hidden characters (Notepad++ with show all chars on):
When my EB environment is updated I get the following eb-engine log:
2022/05/17 07:15:57.025994 [ERROR] An error occurred during execution of command [app-deploy] - [FlipProxyForDotNetCore]. Stop running the command. Error: copy proxy conf from staging failed with error validate nginx configuration failed with error Command /bin/sh -c /usr/sbin/nginx -t -c /var/proxy/staging/nginx/nginx.conf failed with error exit status 1. Stderr:nginx: [emerg] unknown directive "client_max_body_size" in /var/proxy/staging/nginx/conf.d/myConf.conf:1
nginx: configuration file /var/proxy/staging/nginx/nginx.conf test failed
My EB instance is running Amazon Linux 2/2.3.1.
What am I doing wrong?
The error msg
"client_max_body_size"
indicates that you have some non-ASCII characters () in your myConf.conf. Please open the file in a regular text editor and verify that it has only ASCII characters.

Flask internal server error, how to get error logs?

I have this flask application I deployed using Nginx, I get Internal server error in production but in developement it's fine. Is there a way to see what might be the error ? (log file or something)
Have a look in your Nginx' error log.
e.g. /var/log/nginx/error.log or journalctl -u nginx.

Running WireMock server as a stand alone

I am trying to set up a mock server using wireMock as a standalone process. I downloaded the jar file and executed the following command:
java -jar wiremock-standalone-2.23.2.jar --port 0
I had to dynamically determine a port because I am already using the default 8080 port for another program running on my machine. It gave me the port number 55142, but when I tried accessing that on the web, it gave me the following error:
HTTP ERROR 403
Problem accessing /__files/. Reason:
Forbidden
Powered by Jetty://
It's probably due to the fact that you just entered http://localhost:55142
and as there are no mappings in ./mappings directory and files in ./files directory (the same where you have your wiremock.jar file is located)
2019-06-04 00:10:58.890 Request was not matched as there were no stubs registered:
{
"url" : "/"
...
}
please try call with __admin endpoint to see if WireMock is working
http://localhost:55142/__admin
please see also docs here for more nice admin commands.

Gitlab stop working after instal iRedMail

I have a little problem.
I have VPS with debian 8. I have installed on it apache2 serwer and gitlab ce with default settings.
My serwer work on port 80 and my gitlab worked on 81 ( external_url ).
Everything stop working when i installed iRedMail.
Now I have uninstalled iRedMail but gitlab doesn't work.
After use command "gitlab-ctl restart" all packages are ok (gitlab-workhouse, logrotate, nginx, postgresql, redis, sidekiq, unicorn), but If i try to open site with gitlab, I have got error the page timeout.
What and how should check to solve this problem?
I have to add that I hace checked listen ports and nginx are in this list.
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 4534/nginx
---------- EDIT
"stop working" = after I type "external_url" (which worked) I got "Connection timed out".
I have checked logs in /var/log/gitlab for
gitlab-rails, gitlab-shell, gitlab-workhorse, nginx etc.
In gitlab-rails folder I found files : production.log (clear) and sidekiq.log. There are many of ERRORS ( I paste 2 first line, next are similar ):
2015-12-14_14:57:44.37657 2015-12-14T14:57:44.376Z 14796 TID-daijk ERROR: Error fetching message: No such file or directory - connect(2) for /var/opt/gitlab/redis/redis.socket
2015-12-14_14:57:44.37672 2015-12-14T14:57:44.376Z 14796 TID-daijk ERROR: /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:180:in `connect_nonblock'
I Have to add that my apache server works fine on :80.

New MediaTemple site displays '404 File Not Found - nginx' message

I just set up a new new domain and uploaded some simple static html files & assets. The images do not display and when I try to pull one up directly in the browser I get a page that reads
404 File Not Found - nginx
This is weird because although I know media temple uses nginx to run the VMs, the websites are always served up with apache...
Anyway, what led up to this was that I:
created a new webspace
created a new domain within that webspace
uploaded a new image (logo.jpg)
found that logo.jpg would not load and leads to the 404 described above
After creating the new domain, I got an automated message shown below (with specific info removed):
---------- Forwarded message ----------
From: [user] [email]
Date: Thu, Jan 30, 2014 at 12:40 PM
Subject: Unable to configure a web server on the host [domain]
To: [me]
Unable to generate the web server configuration file on the host [domain] because of the following errors:
nginx: [emerg] listen() to [ip address]:80, backlog 511 failed (98: Address already in use)
nginx: configuration file /etc/nginx/nginx.conf test failed
Please resolve the errors in web server configuration templates and generate the file again.
What is the issue here? It's a brand new site - it shouldn't be giving me this kind of grief..
Ok, I have no idea what upset nginx, but the nginx configuration file needed to be refreshed. This was accomplished with the following ssh commands:
/usr/local/psa/admin/sbin/nginxmng --disable
/usr/local/psa/admin/sbin/nginxmng --enable

Resources