nginx

Debian 9 + PHP7.0-FPM + NGINX 1.10.3-1 path_info issue

天涯浪子 提交于 2021-01-28 10:12:11
问题 I'm using DigitalOcean Debian 9 + PHP 7.0 + NGINX 1.10.3-1 and trying to install Joomla! CMS, but at the very first installation screen (example.com/installation/index.php) I've noticed a broken image (which is the Joomla logo), and it looks like this: img src attribute for that image contains "/template/images/joomla.png", but the image is actually located at "/installation/template/images/joomla.png" which means I'm missing the "/installation/" part. Here is my nginx conf part for the PHP:

Debian 9 + PHP7.0-FPM + NGINX 1.10.3-1 path_info issue

老子叫甜甜 提交于 2021-01-28 10:04:31
问题 I'm using DigitalOcean Debian 9 + PHP 7.0 + NGINX 1.10.3-1 and trying to install Joomla! CMS, but at the very first installation screen (example.com/installation/index.php) I've noticed a broken image (which is the Joomla logo), and it looks like this: img src attribute for that image contains "/template/images/joomla.png", but the image is actually located at "/installation/template/images/joomla.png" which means I'm missing the "/installation/" part. Here is my nginx conf part for the PHP:

Playing WAV file in Chrome fails

百般思念 提交于 2021-01-28 08:47:04
问题 I'm writing web application where users can listen audio (WAV) files using soundmanager2. Application is running on Amazon micro instance, but static files are served from my university server. Everything seemed to work fine, but I encountered problem with playing audio from Chrome browser but ONLY when files are served from university server. The same file served from Amazon server works fine in all browsers. If you want to test I paste links bellow. Amazon (APACHE) - works on all browsers:

Disable web access via direct IP address on AWS OpsWorks Nginx/Unicorn server

随声附和 提交于 2021-01-28 08:27:09
问题 I have a Rails app running on an AWS OpsWorks Nginx/Unicorn Rails Layer. I want my app to only process requests to api.mydomain.com and have my web server directly return a 404 if any request is made using the server's IP address. I've implemented a custom cookbook that overrides unicorn/templates/default/nginx_unicorn_web_app.erb (from the opsworks-cookbooks repo: https://github.com/aws/opsworks-cookbooks). I copied the template file that exists in this repository and added a new server

How to disable gzip compression for text/html?

妖精的绣舞 提交于 2021-01-28 08:14:10
问题 My gzip config looks like this: gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_min_length 1500; gzip_types text/css application/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype; You will notice that text/html is not in my list of types, but Chrome is showing that it's gzipped anyway. This article says that text/html is enabled by default. I want to

NGINX try_files with name as the last word in the $uri

雨燕双飞 提交于 2021-01-28 07:42:50
问题 I've got an nginx on my server and I am trying to get it to open the file ' /config/www/pp1/index.php ' for address https://example.com/pp1 and ' /config/www/interpreter/index.html ' for https://example.com/interpreter. Furthermore all things like https://example.com/interpreter/res/docs should fire up ' /config/www/interpreter/res/docs.html '. I have made many attempts. Currently my default config file in /site-confs looks like this: server { listen 80; listen 443 ssl http2; server_name kni

NGINX try_files with name as the last word in the $uri

对着背影说爱祢 提交于 2021-01-28 07:31:36
问题 I've got an nginx on my server and I am trying to get it to open the file ' /config/www/pp1/index.php ' for address https://example.com/pp1 and ' /config/www/interpreter/index.html ' for https://example.com/interpreter. Furthermore all things like https://example.com/interpreter/res/docs should fire up ' /config/www/interpreter/res/docs.html '. I have made many attempts. Currently my default config file in /site-confs looks like this: server { listen 80; listen 443 ssl http2; server_name kni

Allowing only local network access in NGINX

为君一笑 提交于 2021-01-28 06:25:26
问题 I have a single physical server running several server blocks in nginx corresponding to different subdomains. One of them I'd like to be only accessible from devices on the same local network as the server. I know theoretically this can be done with allow 192.168.1.0/24; deny all; within a location block. When I actually try to access the server from a local device, though, the request is denied. Looking at the access logs, this is because the request is shown as coming from my network's

Add avif images in HTML using nginx as a server

*爱你&永不变心* 提交于 2021-01-28 06:23:18
问题 I created some avif images with heif-anc : for i in card*.png ; do heif-enc "$i" -o "${i%.*}.avif" ; done But When I added them to my website, it just proposed to download the image instead. Then I enabled avif images in my nginx-config with http { types { image/avif avif; } ... Now it tries to display the image, but they seem to be broken. If you call it directly, Firefox with successfully enabled avif support shows this error message: avif could not be displayed because it contains errors

Shell can't find nginx

允我心安 提交于 2021-01-28 06:10:35
问题 try to prompt this command nginx -V but shell returns fish: Unknown command “nginx” If I try sudo service nginx status I could see Usage: /etc/init.d/nginx {start|stop|restart|reload|force-reload} Why nginx -V is not work? 回答1: /etc/init.d/nginx is a shell script to start/stop/... the nginx service $ file /etc/init.d/nginx /etc/init.d/nginx: POSIX shell script, ASCII text executable nginx binary is different and usually present in /usr/sbin/ . Add that directory to your PATH . $ file /usr