Nginx error favicon ico

Error while setting up ssl, «/usr/share/nginx/html/favicon.ico» failed (2: No such file or directory) While setting up my ssl using lets encrypt, I keep getting the following error: My nginx.conf file is: The site was working perfectly without ssl/HTTPS, but after I installed it keeps showing the default page, How do I resolve it? PS […]

Содержание

  1. Error while setting up ssl, «/usr/share/nginx/html/favicon.ico» failed (2: No such file or directory)
  2. Popular Topics
  3. Questions
  4. Welcome to the developer cloud
  5. nginx failed (13: Permission denied) uwsgi (502 bad gateway)
  6. 3 Answers 3
  7. Arch Linux
  8. #1 2017-06-08 01:10:22
  9. nginx and php-fpm [SOLVED] (but still welcome more insight)
  10. #2 2017-06-08 03:39:57
  11. Re: nginx and php-fpm [SOLVED] (but still welcome more insight)
  12. #3 2017-06-08 03:55:28
  13. Re: nginx and php-fpm [SOLVED] (but still welcome more insight)
  14. Nginx reverse proxy not loading resources from another port
  15. 1 Answer 1
  16. favicon.ico did not show when prod env #5385
  17. Comments
  18. Version
  19. Reproduction link
  20. Steps to reproduce
  21. What is expected ?
  22. What is actually happening?
  23. Additional comments?
  24. Footer

While setting up my ssl using lets encrypt, I keep getting the following error:

My nginx.conf file is:

The site was working perfectly without ssl/HTTPS, but after I installed it keeps showing the default page, How do I resolve it?

PS : UNABLE TO ADD Let’s encrypt as a tag in the bottom, ERROR: Tag list contains an invalid tag «Let’s Encrypt»

Help much Appreciated

Thank you, Madhav

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

As far as I can see, your Nginx proxy rules are currently present only under the Nginx server block that serves port 80/http. You need to also carry over those rules to the Nginx server block for the port 443/https. Because at the moment you don’t have any proxy rules specified for port 443 so Nginx is not proxying the requests to your backend service.

Basically add the following rules to the server block for port 443:

Then run a config test with:

If you get Syntax OK then restart Nginx.

Let me know how it goes! Best, Bobby

Popular Topics

Questions

Sign up for Infrastructure as a Newsletter.

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

You get paid; we donate to tech nonprofits.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Источник

nginx failed (13: Permission denied) uwsgi (502 bad gateway)

I am having trouble running my application on a new DigitalOcean droplet. The machine runs CentOS 6.5

The error messages printed in the nginx error.log whenever I make a web request to 104.xxx.x.xxx:8080

project folder: drwxr-xr-x 6 webdev www-data 4.0K Nov 19 23:40 ers_portal

socket inside that folder: srw-rw-rw- 1 webdev www-data 0 Nov 19 23:45 ers_portal_uwsgi.sock

If you have any additional info you need just let me know. Thanks!!

EDIT

I changed the permissions as suggested by @Eugene. Now in my /var/log/nginx/access.log I see

In /var/log/nginx/error.log I see

The favicon.ico rejection (below) that was in var/log/nginx/access.log isn’t showing up anymore

3 Answers 3

Solved

I found my typo after many hours of searching. In /path/to/my/webapp/my_app_nginx.conf the line that reads

Also, in /etc/nginx/nginx.conf change user nginx www-data; back to user nginx;

Also ensure that there is not a default server block in the «top-level» /etc/nginx/nginx.conf that conflicts with your app’s configuration (in my case /path/to/my/webapp/my_app_nginx.conf , which is symlinked to the /etc/nginx/conf.d/ folder).

  1. Don’t get discouraged. The worst (maybe second worst) feeling in the world is not being able to figure something out over an extended period of time. Especially if this is your hobby, it can be easy to feel that you’re incompetent and this stuff is too hard and you’re not good enough. Stick at it.
  2. Be methodical. I was getting change-crazy, especially at the end there. This results in going to bed with no real progress and waking up in the same spot you were. Write it all down, document what you have tried and keep track of previous changes. if ABABA is the working config, and —B- was the change you were looking for, but you forgot to change —B— back to —A— , you will repeat and repeat and repeat yourself. See #1
  3. Remember sometimes the most important thing to reaching your solution is to get up and walk away.
  4. Don’t discount the knowledge of your peers (this community). While they may not have the instant answer for your particular problem, remember All of us isn’t as dumb as none of us (or some silly saying like that). We all have a deep-seated love of scrubbing problems from the planet, one at a time.

Источник

Arch Linux

You are not logged in.

#1 2017-06-08 01:10:22

nginx and php-fpm [SOLVED] (but still welcome more insight)

So installed nginx and php-fpm but the odd thing is that I have no «sites-enabled» or «sites-available» directories.

This is my /etc/nginx/nginx.conf

but when I go to localhost it still is looking for things in the wrong document root and I don’t see where I could have set

when I symlink it there:
sudo ln -s /usr/share/nginx/html /etc/nginx/html
I get this in the logs if I don’t have a favicon, but otherwise I don’t get anything

and this appears:

There seems to be something wrong, do you know what that is, why I don’t have a sites-enabled or a sites-available, and how do I change my document root? Thanks.

Last edited by felixtheratruns (2017-06-08 04:06:18)

#2 2017-06-08 03:39:57

Re: nginx and php-fpm [SOLVED] (but still welcome more insight)

just tried folowing this tutorial: https://support.rackspace.com/how-to/in … e-sockets/
but changing it for my file structure.
and I get this when I go to localhost in my browser:

symlinked the file:
ls -l /etc/nginx/sites-enabled/localhost

output of:
journalctl -ex

Last edited by felixtheratruns (2017-06-08 15:06:28)

#3 2017-06-08 03:55:28

Re: nginx and php-fpm [SOLVED] (but still welcome more insight)

TO BE VERY CLEAR: this is for the setup that I had in my reply, NOT the setup in my original post.

well silly me, had to change /etc/nginx/sites-enabled/localhost

and here’s the file I tested it with: (the file and all the directories it is in are owned by root, yeah not sure why that works with the http user that is set, I guess http is just the process the server runs under)
/srv/http/localhost/index.php

TO BE VERY CLEAR: this is for the setup that I had in my reply, NOT the setup in my original post.

Last edited by felixtheratruns (2017-06-08 04:04:41)

Источник

Nginx reverse proxy not loading resources from another port

My nginx root is /usr/share/nginx/html/ and my Node.js App is at /root/app/. But the reverse proxy searches for the app at nginx root.

I used the following location block.

And changed the base uri in the app’s config to

But I get a blank page, but the title bar says «AppName«

Here is the nginx error log

How can I successfully reverse proxy without moving my app from /root/app to the nginx root?

UPDATE :

On viewing the source of the page, I can see that nginx is trying to load resources from /static/js and /static/css at http://139.59.46.93 when it should be loading them from http://139.59.46.93:3000

So it is basically proxying the port, but not the resources.

How do I pass the resources too?

1 Answer 1

You are using /t in location , but rewrites ^/t/(.*) , so nginx doesn’t rewrite request to /t and it is passed to your app as is.

In general, you should always use trailing slash in location directive that should match directory (unless you’re absolutely sure, you don’t need it).

Also there is a shortcut for this common case to replace location prefix in nginx. Try this one:

Documentation on proxy_pass says:

A request URI is passed to the server as follows:

  • If the proxy_pass directive is specified with a URI, then when a request is passed to the server, the part of a normalized request URI matching the location is replaced by a URI specified in the directive.

Nginx will replace /t/ in location directive with / from proxy_pass directive.

Probably you have to change app’s baseURI to /t/ too.

Источник

favicon.ico did not show when prod env #5385

Version

Reproduction link

Steps to reproduce

on linux server, i clone the project, then run «yarn run build» and «pm2 start npm —name «cygy-www» —watch — run start»,
use nginx reverse proxy reflex on port 3000, visti domain, the favicon did not show

What is expected ?

the favicon.ico show

What is actually happening?

the favicon did not show

the favicon.ico showed on dev env.

The text was updated successfully, but these errors were encountered:

Hi, i tried to reproduce and lost the any resources except the index, no matter product or development environment.
But i found an error in nginx.conf that proxy_pass https://internal.ip:port; . Missing a / after the port and everything goes wrong. Fix to proxy_pass https://internal.ip:port/; , it’s gonna be all right.
So is any possible with nginx?

Nuxt ^2.4.0
Nginx 1.14.0

hello,vanpipy
i want to know where is favicon.ico after builded, i can’t find it in .nuxt/build/client
and my nginx.conf is>

I got it, here is the document to explain it. it is Nuxt static.

All included files will be automatically served by Nuxt and are accessible through your project root URL. (static/favicon.ico will be available at localhost:3000/favicon.ico)

Follow this, the favicon.ico is still in the directory static.

okay,i had solved the issue.

on nginx.conf, i should add

then ‘https://www.xx.com/favicon.ico’ can be Point nuxtProject/static

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

I am trying to serve a Vue app which is basically serving static files. I have the simple configuration, which also includes the backend PHP API server.

When I go to api.myapp.home (I added it to the hosts file), I do see the backend html page. but when I go to myapp.home, it sends me to the 50x error page:

user       www-data;

http {
    server {
        listen 80;
        server_name api.myapp.home;
        root /var/www/php-backend/public; 
        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-Content-Type-Options "nosniff"; 
        index index.php;
 
        charset utf-8;
 
        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }
 
        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }
 
        error_page 404 /index.php;
 
        location ~ .php$ {
            fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
            include fastcgi_params;
        }
 
        location ~ /.(?!well-known).* {
            deny all;
        }
    }
    
    server {
        listen 80;
        server_name myapp.home;
        location /var/www/vue-frontend/dist {
            root   /;
            index  index.html;
            try_files $uri $uri/ /index.html;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
    }     

}
events {}

When going to myapp.home, I keep seeing the index.html page that’s inside /usr/share/nginx/html; instead of the Vue index.html. Why? the error.log at /var/log/nginx is showing the following:

[notice]: signal process started
[error]: *53 open() «/usr/share/nginx/html/favicon.ico» failed (2: No such file or directory), client: 127.0.0.1, server: myapp.home, request: «GET /favicon.ico HTTP/1.1», host: «myapp.home», referrer: «http://myapp.home/»

But I defined the location as /var/www/vue-frontend/dist with root /, which is where the index.html and favicon.ico is. So why does it look for the favicon.ico in the error pages location?

I am using Nginx as my webserver for the first time. I didn’t have any trouble to set it up and everything works great. The problem came when the designer asked me if he could send me «the icon in the title bar» to «put it up there».

# /opt/nginx/conf/nginx.conf
...
server {
    listen 80 ;
    server_name *.website.com website.com;
    root /home/webuser/sites/website;
}

My directory:

/home/webuser/sites/website/
|_ index.html
|_ main.css
|_ favicon.ico

Is it possible to put a specific favicon.ico to each Virtual Host? Where should you put that file and how can you configure it?

EDIT:

I just realized that it was a completely different problem. Both answers were right but my problem was the permission. I don’t know why the file favicon.ico ended up having permissions 600 and of course the moment I did:

chmod +r favicon.ico

Worked like a charm. I will leave this here if it happens to someone else.

asked Sep 5, 2011 at 13:49

ersamy's user avatar

ersamyersamy

4531 gold badge4 silver badges5 bronze badges

3

favicon.ico file should be placed in website root directory which is defined by nginx root directive. Or you could pass URL to favicon by using following code in HTML:

<link rel="shortcut icon" href="http://example.com/myicon.ico" />

answered Sep 5, 2011 at 13:58

AlexD's user avatar

AlexDAlexD

8,3042 gold badges29 silver badges38 bronze badges

4

This is how we do it in our specific vhost config (sites-available/[vhostconfigfile]) under the server directive:

location = /favicon.ico {
    alias /var/www/media/images/favicon.X.ico;
}

That way you can put it anywhere you want with no html whatsoever.

The «.X.» is not required at all, and only denotes that you can change this filename to anything you like. I simply use the «.X.» as a placeholder to identify the specific sub domain that I am referencing. Its purely for organization.

answered Jan 23, 2012 at 20:00

eficker's user avatar

efickereficker

8831 gold badge7 silver badges8 bronze badges

6

This means, wherever the virtual host’s files are taken from (root directory) you should put that specific favicon.ico file.

answered Sep 5, 2011 at 13:59

U4iK_HaZe's user avatar

U4iK_HaZeU4iK_HaZe

6315 silver badges13 bronze badges

Понравилась статья? Поделить с друзьями:
  • Nginx error 401
  • Nginx error 256 root library launchagents homebrew mxcl nginx plist
  • Nginx disable error pages
  • Nginx custom error pages
  • Nginx cors error