7 votes

Nginx displaying failed (13: Permission denied) when trying to access new site

A good way to debug such nginx errors is by checking the logs and using namei to check whether nginx has access to all ancestor folders. Consider /static/vendor.js gives a HTTP 403 due to this ...
Herbert's user avatar
  • 201
4 votes

How to block .git Folder serverwide on NGINX?

You might want to block all locations starting with a dot on any level, i.e. .env, .git, .htaccess, etc. and make it look like there is no such location at all instead of confirming its existence to ...
Aleksei Novikov's user avatar
4 votes
Accepted

Apache GZIP for images - any reason?

Adding gzip compression (with default settings) to that particular file does make it slightly (± 1.7 percent) smaller when I compare the 1019174 bytes for the original file versus 1001991 bytes for ...
HBruijn's user avatar
  • 80.3k
3 votes
Accepted

How can I troubleshoot an iptables rule that is preventing internet access from my server?

The default DROP policy in your ruleset affects the replies: your query was done, a reply was sent back from remote to your server, and then your server dropped this reply. Final result: no reply ...
A.B's user avatar
  • 12.8k
3 votes

Traefik routing to two ports in one docker container

After some searching, I found that you need to explicitly name the services when there's more than one in a container. version: "3" services: # The `proxy` service set up two entrypoints ...
Don Kirkby's user avatar
  • 1,514
2 votes

Lightweight HTTP to HTTPS redirect

Since @symcbean mentioned using systemd sockets instead of xinetd, and I stumbled upon the same problem, I'll post my solution. One needs to put two files in /etc/systemd/system. This service, let's ...
M. Zhang's user avatar
  • 121
2 votes
Accepted

Lightweight HTTP to HTTPS redirect

Minimal: while true ; do nc -l -p 80 \ -c 'echo -e "HTTP/1.1 302 Moved Temporarily\nLocation: https://yourhost.example.com/\n\n"' ; done although I'd run it via xinetd (and redirect to ...
symcbean's user avatar
  • 22.4k
2 votes
Accepted

What is the best way to redirect port 80 connections to port 8080 with ipv6?

Elsewhere on Server Fault (and other Stack Exchange sites) you can find more complete answers of options for low-numbered unprivileged ports. For Linux, I prefer authbind, a hack where a setuid ...
John Mahowald's user avatar
2 votes
Accepted

Is it better to redirect root to www or www to root?

The www. prefix is a remnant from the glorious old 90s when you had a single machine for each service, like FTP, WWW, SMTP etc. and had to use a separate hostname for each one. The apex/bare domain ...
AlexD's user avatar
  • 10.3k
2 votes
Accepted

Can I use my letsencrypt wildcard cert on BOTH my webserver and DoH server?

From the unbound documentation... Enabling DoH in Unbound is as simple as configuring the TLS certificate and the corresponding private key that will be used for the connection, and configuring ...
Trent Murgatroyd's user avatar
1 vote

How to assign different ipv6 for each domain in nginx?

Your PHP script does not determine the incoming IP address, it determines the IP address for outgoing connections. Not tested, but you should be able to forward the variable $server_addr to php_fpm ...
Gerald Schneider's user avatar
1 vote

Nginx webserver not available with global IPv6 Address

A simple policy could be for a server to listen on the service port for any destination address. In nginx, unfortunately v6 is not the default if just given a port number. However can enable v6 with ...
John Mahowald's user avatar
1 vote
Accepted

Apache says certificate not valid for 192.168.0.44, but it is valid for 192.168.0.44

Your alt names is incorrect. It should be [ alt_names ] IP.1 = your_ip_address By the way a certificate is never created for an ip adress and will never be trusted. You can create a certificate based ...
Turdie's user avatar
  • 2,594
1 vote

Apache redirect http://%{HTTP_HOST}:%{SERVER_PORT}/%{REQUEST_URI} to https://%{HTTP_HOST}%{REQUEST_URI}

If the Redirect directive is used within a <Location> or <LocationMatch> section with the URL-path omitted, then the URL parameter will be interpreted using expression syntax. This syntax ...
Esa Jokinen's user avatar
  • 49.8k
1 vote

PHP mail.add_x_header not showing in log

EDIT: If I look at the mail headers I receive, I see the X-PHP-Originating-Script: line in there. Perhaps I've misunderstood - is that all the php.ini directive does? Yes. As indicated by the fact ...
vidarlo's user avatar
  • 9,309
1 vote

Point many domains to a single simple web form, using nothing but domain records configuration

Now he and me both have websites and webhosting from a reseller party. So we have that available. But there does not seem to be a configuration option to have a 'catch-all domain' website, or a ...
Nikita Kipriyanov's user avatar
1 vote

Apache Httpd: Logging Access for Non-privileged Users

Is it common to restrict access to /var/log/.... ? Yes Is it common to allow the owners of websites visibility of their logs? Yes Your issue is how to configure this so that Apache can write the logs, ...
symcbean's user avatar
  • 22.4k
1 vote

Apache Httpd: Logging Access for Non-privileged Users

There is no good reason IMHO to store the logs in a location that the webmaster cannot access. Since it looks like you already create specific logs for each VirtualHost, adjust where you store them to ...
Herman's user avatar
  • 46
1 vote

Online monitoring / dashboard service for multiple metrics

Many monitoring services support and provide agents to monitor all kinds of properties on your servers as well as custom checks for things/metrics they don't support natively already. Install the ...
HBruijn's user avatar
  • 80.3k
1 vote

Online monitoring / dashboard service for multiple metrics

Datadog monitors web availability, server performance, backup status. https://www.datadoghq.com/
fopsik's user avatar
  • 615
1 vote

Server authorization based on token with expiration

To achieve the desired video streaming authorization method, you may need to implement a custom solution. One possible approach could be to generate a unique token for each user requesting access to ...
Nibin Baby's user avatar
1 vote

Apache: Return static string for location

A better solution is to use mod_lua. This also obviates the need for mod_rewrite (which the httpd docs discourage). See https://gist.github.com/james2doyle/f09b0e159bb30836e593 for an example.
NodeUnderflow's user avatar
1 vote

How to view a log file realtime (similar to "tail -f") via web

What you are looking for is a real-time logs browser which is a piece of a simple software that either listens to files with logs or STDIN and prints it to the UI. Depending on the problem you're ...
spinache's user avatar
1 vote

Nginx displaying failed (13: Permission denied) when trying to access new site

In my case, it was fixed (from this blog) by running the command: semanage permissive -a httpd_t and restarting NGINX service.
Genarito's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible