Quantcast
Channel: Nginx Forum - How to...
Viewing all 2931 articles
Browse latest View live

nginx+Go (no replies)

$
0
0
Hello!
I want to use nginx+Go in simple web app.
How I can do it using Go as 1)script (file xxx.go) 2)binary app
For example I have file hello.go in the nginx root:

package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}

I should get:
http://myhost/hello.go
hello, world

Global search and replace on all header lines (no replies)

$
0
0
New to Nginx, trying to simply do a global search and replace of a string on all header lines while using proxy pass. The substitution module seems to work fine for search and replace on the response body. How do I do the same for all response headers?

Thanks

How to log $upstream_addr with fastcgi_cache_background_update on (no replies)

$
0
0
When fastcgi_cache_background_update is on nginx make request in background.

In that case $upstream_cache_status = STALE, $request_time equal to real upstream response time, but $upstream_addr and $upstream_response_time is empty.

How can I log correct $upstream_addr to identify which backend processed the request.

logging to syslog (no replies)

$
0
0
Hello,

I'm trying to setup logging to syslog by following the instructions here;
https://www.nginx.com/resources/admin-guide/logging-and-monitoring/

The issue i'm hitting is that if i throw in say, this line
access_log syslog:server=our.syslog.server,facility=local7,tag=nginx,severity=warn;

It'll just log it to a log file named "our.syslog.server,facility=local7,tag=nginx,severity=warn" in /usr/share/nginx . Which will eventually grow and consume all the disk space on the server.
It does this whether I try to log to an external syslog server or the systems syslog. Can anyone point me to what i'm doing wrong?

Thanks!

reserved proxy to edit a file (no replies)

$
0
0
hey,

i want to edit a m3u file which i download from tvheadend... the file looks like this


#EXTINF:-1 tvg-id="caa2fba86f064731beb97ed03f8cddf5",channel1
http://ip:9981/stream/channelid/687579850
#EXTINF:-1 tvg-id="bc97bedf581ea1bcbdb0d7db004b2245",channel2
http://ip:9981/stream/channelid/1606326204
#EXTINF:-1 tvg-id="d9d45e620c219249c2d4345d7d46fd4c",channel3
http://ip:9981/stream/channelid/1650382041
#EXTINF:-1 tvg-id="d950ed45a7ec93c02a196d56a097a175",channel4
http://ip:9981/stream/channelid/1173180633

the file is available at http://username:password@ip:9981/playlist... so now i want to get a edited file that looks like this:


#EXTINF:-1 tvg-id="caa2fba86f064731beb97ed03f8cddf5",channel1
http://username:password@ip:9981/stream/channelid/687579850
#EXTINF:-1 tvg-id="bc97bedf581ea1bcbdb0d7db004b2245",channel2
http://username:password@ip:9981/stream/channelid/1606326204
#EXTINF:-1 tvg-id="d9d45e620c219249c2d4345d7d46fd4c",channel3
http://username:password@ip:9981/stream/channelid/1650382041
#EXTINF:-1 tvg-id="d950ed45a7ec93c02a196d56a097a175",channel4
http://username:password@ip:9981/stream/channelid/1173180633


is it possible that nginx edit the file for me with the different usernames...?

greetz and thanks

How do I prove to myself that the least_conn directive is working as an HTTP load balancing mechanism? (no replies)

$
0
0
I have configured a reverse proxy with Nginx. One Nginx instance distributes to three other Nginx web servers. I have used the proxy_pass directive and the least_conn directive. If I go directly to one of the servers that the reverse proxy distributes to (and bypass the reverse proxy), this does not seem to count as an active connection. Or I did not correctly implement the "least_conn;" directive correctly.

I am using the free version of Nginx. How long does the connection last? Is it just the download process? The web pages are just the default .html page. I want to test the least_conn; directive. So far I have seen no evidence that it is working. I have written a script to download the landing page several times. I configured one of the three servers to have a very big html page while keeping the others the same. This way download it takes time. The script downloading the landing page does not seem to be the equivalent of a connection. I have taken down one or two Nginx web servers. It seems like only round robin distribution is working.

How can I prove to myself that the least_conn directive is working with Nginx being a reverse proxy and an HTTP load balancer?

Can you use weight and max_fails or fail_timeout with the same server? (no replies)

$
0
0
In default.conf I created a upstream backed {} section. For some servers I have used a weight=3. For these same servers, can I configure a max_fails= or fail_timeout= setting? Whenever I try both weight=3 and a max_fails or fail_timemout separate only by a space after the number "3", the Docker container will not start again. Is there a way to reconcile this and use a weight setting with a max_fails or fail_timeout setting too?

Is there a bug with the ip_hash directive when trying to use Nginx as an HTTP load balancer from a Docker container? (no replies)

$
0
0
I have the free version of Nginx running in Docker containers on a RedHat Linux server in AWS. I have configured proxy_pass to act as an HTTP load balancer. There is one Nginx instance that distributes traffic to other Nginx instances running in Docker containers. This distributor container fails if I introduce the ip_hash; directive inside the upstream backend {} section. The default.conf file may have this clause:


...
upstream backend {
server goodname1.com;
server goodname2.com;
server goodname3.com;
}

The above works. I can stop and restart the Docker container. I can prove round-robin distribution happens as I expect too.

If I add the ip_hash directive, the Docker container will never start again. For example, if I modify the default.conf file to look like this:

...
upstream backend {
ip_hash;
server goodname1.com;
server goodname2.com;
server goodname3.com;
}

once I stop the container, I can never restart it. The Docker container is never usable again. This problem is 100% reproducible. Has anyone else experienced this? Is it a bug with Nginx and Docker or am I doing something wrong?

Loadbalance a website that only support https (1 reply)

$
0
0
Hello,

I want to load-balance a web page that only supports https. For me it is ok to terminate the incoming https connection and create a new one.
I tried with this config:

http {

upstream myapp1 {
server page1.myregion.cloudapp.azure.com:443;
server page2.myregion.cloudapp.azure.com:443;
}

server {
listen 443 default ssl;

ssl_certificate /etc/nginx/certs/portal-cert.pem;
ssl_certificate_key /etc/nginx/certs/portal-key.pem;

location / {
proxy_pass https://myapp1;
proxy_ssl_verify off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_ssl_certificate /etc/nginx/certs/portal-cert.pem;
proxy_ssl_certificate_key /etc/nginx/certs/portal-key.pem;
proxy_ssl_server_name on;
proxy_ssl_protocols SSLv2 SSLv3 TLSv1.1 TLSv1.2 TLSv1.3;
}
}
}

The log say still http:
[25/Jul/2017:14:14:59 +0000] 1XX.XXX.XXX.238 - - - to: 1XX.XXX.XXX.XXX:443: GET / HTTP/1.1 upstream_response_time 0.342 msec 1500992099.260 request_time 0.342 500 3003 "-

Also the upstream web page give me a error page with Status 500 say http is not allowed because https is expected.

What did I miss?

Thanks,
Daniel

Disable NGINX caching 304 Responses from Origin Server (no replies)

$
0
0
We have a pretty simple setup with NGINX sitting on the front and a backend server (on a separate physical server) that provides the content.

Nginx then caches content based on the EXPIRES and Cache-Control headers set by the origin server.

We noticed that NGINX was not issuing 304 headers to images that were not in the local NGINX cache when the If-Modified-Since header was sent by the client. Instead, it would issue a 200 with the full data file.

To fix this, we applied:
proxy_set_header If-Modified-Since $http_if_modified_since

So then the If-Modified-Since header was passed to the backend and of course, it returned correctly with the 304 header - great.

But what we noticed was that NGINX would cache this 304 response and deliver future responses as 304 to clients even without the If-Modified-Since header.

How can we disable caching of 304 responses and fix this issue?

Thank you for your help, suggestions, and tips in advance.

Access to AWS S3 (no replies)

$
0
0
Hi,

I'm trying to access AWS S3 object store from NGINX. For that I'm using aws_access_key, aws_key_scope and aws_endpoint directives.
AWS S3 V4.0 requires generation of a signing key to access it. Signing building is described in http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html

When calling NGINX I get:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<AWSAccessKeyId>AKIAIDFAAXDZLSTALIUA</AWSAccessKeyId>
<StringToSign>AWS4-HMAC-SHA256
20170905T142136Z
20170905/eu-central-1/s3/aws4_request
12ae1791c6031cd57b85f468111089e01acd83bd81380861d105f469712c5f64</StringToSign>
<SignatureProvided>d9241ee35763220b68f890489a931317ba9ea7087e5170bb8898d138f8a87601</SignatureProvided>
<StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 37 30 39 30 35 54 31 34 32 31 33 36 5a 0a 32 30 31 37 30 39 30 35 2f 65 75 2d 63 65 6e 74 72 61 6c 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 31 32 61 65 31 37 39 31 63 36 30 33 31 63 64 35 37 62 38 35 66 34 36 38 31 31 31 30 38 39 65 30 31 61 63 64 38 33 62 64 38 31 33 38 30 38 36 31 64 31 30 35 66 34 36 39 37 31 32 63 35 66 36 34</StringToSignBytes>
<CanonicalRequest>GET
/737f87dc-3fc1-47d1-aafc-2cfbb71d9e6a/rulesUI/1.0/xs-app.json

host:hcp-7973a98f-67bc-49d7-b909-8cb5acd52dcc.s3-eu-central-1.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20170905T142136Z

host;x-amz-content-sha256;x-amz-date
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</CanonicalRequest>
<CanonicalRequestBytes>47 45 54 0a 2f 37 33 37 66 38 37 64 63 2d 33 66 63 31 2d 34 37 64 31 2d 61 61 66 63 2d 32 63 66 62 62 37 31 64 39 65 36 61 2f 72 75 6c 65 73 55 49 2f 31 2e 30 2f 78 73 2d 61 70 70 2e 6a 73 6f 6e 0a 0a 68 6f 73 74 3a 68 63 70 2d 37 39 37 33 61 39 38 66 2d 36 37 62 63 2d 34 39 64 37 2d 62 39 30 39 2d 38 63 62 35 61 63 64 35 32 64 63 63 2e 73 33 2d 65 75 2d 63 65 6e 74 72 61 6c 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 0a 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35 0a 78 2d 61 6d 7a 2d 64 61 74 65 3a 32 30 31 37 30 39 30 35 54 31 34 32 31 33 36 5a 0a 0a 68 6f 73 74 3b 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3b 78 2d 61 6d 7a 2d 64 61 74 65 0a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35</CanonicalRequestBytes>
<RequestId>699D8417F44C5317</RequestId>
<HostId>LIP0/69lWZub7NXoBiwu7ms0aigWuz8oVy0om9P2rbgNsC3Y+NITYZre4KMgWhY20iWvobiKQ9I=</HostId>
</Error>

See attached nginx.conf file.
Can you assist with this configuration?

Thanks, Sergio

Nginx access log variables not set when the header-reading times out (no replies)

$
0
0
Is there a way to set user-defined variables and use them in access logs before the NGINX rewrite phase?
In some error scenarios, like the one defined below, we end-up in the access log phase before any user variable is set.

The following is the access log format example I have:

log_format main '$remote_addr $server_addr $http_host $custom_destination_addr [$custom_request_time] '
' "$request" $status $body_bytes_sent "$http_user_agent" ';

The fields that start with "custom_" are user-defined variables.

When I send the following get message that has a non-terminated header; i.e., header terminated with "/r/n" instead of "/r/n/r/n":

get = "GET /Vod/mod/video16k_1.mp4 HTTP/1.1\r\nHost: 10.20.20.10:8585\r\nUser-Agent: HTTP Test Suite TestSuite/1.0.2\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Encoding: gzip,deflate\r\nConnection: keep-alive\r\n"

I get the following info in error.log:
[info] 28875#0: *1 client timed out (110: Connection timed out) while reading client request headers, client: 10.20.20.128, server: , request: "GET /Vod/mod/video16k_1.mp4 HTTP/1.1", host: "10.20.20.10:8585"

Then, it generates an access log entry where ALL the user-defined variables are found uninitialized:

2017/09/01 10:03:07 [warn] 28875#0: *1 using uninitialized "custom_destination_addr" variable while logging request, client: 10.20.20.128, server: , request: "GET /Vod/mod/video16k_1.mp4 HTTP/1.1", host: "10.20.20.10:8585"

2017/09/01 10:03:07 [warn] 28875#0: *1 using uninitialized "custom_time" variable while logging request, client: 10.20.20.128, server: , request: "GET /Vod/mod/video16k_1.mp4 HTTP/1.1", host: "10.20.20.10:8585"

Access log entry:

10.20.20.128 10.20.20.10 10.20.20.10:8585 [] "GET /Vod/mod/video16k_1.mp4 HTTP/1.1" 408 0 "" "HTTP Test Suite TestSuite/1.0.2"

When I properly set the end of header "/r/n/r/n", then the access logs are fine.

Therefore, under the error condition above (time out when reading header), the access log variables that are user-defined will ALL get EMPTY.

Is there a known solution to this problem, or do we need a new concept/feature in NGIMX to support variable-setting before rewrite phase?

Thanks

Nagios on nginx with fcgi/fcgiwrap (no replies)

$
0
0
Hi All,

I am trying to set up Nagios to run with nginx using fcgi/fcgiwrap and am receiving a "connection refused" to the defined socket:

2017/09/06 17:32:12 [error] 117059#117059: *5 connect() to unix:/var/run/fcgiwrap.socket failed (111: Connection refused) while connecting to upstream, client: 10.29.14.22, server: nagios.node.com, request: "GET /nagios/cgi-bin/status.cgi?hostgroup=all&style=hostdetail HTTP/1.1", upstream: "fastcgi://unix:/var/run/fcgiwrap.socket:", host: "server.node.com:8000", referrer: "http://server.node.com:8000/side.php"

rhel 7
nginx 1.12.1
php 5.4.16
php-fpm 5.4.16
fcgi-2.4.0-25.el7.x86_64
fcgiwrap-1.1.0-1.gf.el7.x86_64

I've been trouble-shooting for a couple days now and have found some info searching around but haven't found a solution yet. I am a novice when it comes to php/fcgi*.

I have read that I can use systemd for fcgiwrap and am attempting to use the following for the service:

fcgiwrap.service -

[Unit]
Description=Simple CGI Server
After=nss-user-lookup.target

[Service]
ExecStart=/usr/sbin/fcgiwrap
User=nginx
Group=nginx

[Install]
Also=fcgiwrap.socket

fcgiwrap.socket -

[Unit]
Description=fcgiwrap Socket

[Socket]
SocketMode=0600
SocketUser=nginx
SocketGroup=nginx
ListenStream=/var/run/fcgiwrap.socket

[Install]
WantedBy=sockets.target

When I start the service:

# systemctl start fcgiwrap.service
# systemctl status fcgiwrap.service

fcgiwrap.service - Simple CGI Server
Loaded: loaded (/etc/systemd/system/fcgiwrap.service; indirect; vendor preset: disabled)
Active: inactive (dead)

Sep 06 16:31:33 server systemd[1]: Started Simple CGI Server.
Sep 06 16:31:33 server systemd[1]: Starting Simple CGI Server...
Sep 06 17:01:00 server systemd[1]: Started Simple CGI Server.
Sep 06 17:01:00 server systemd[1]: Starting Simple CGI Server...
Sep 06 17:08:01 server systemd[1]: Started Simple CGI Server.
Sep 06 17:08:01 server systemd[1]: Starting Simple CGI Server...
Sep 06 17:20:55 server systemd[1]: Started Simple CGI Server.
Sep 06 17:20:55 server systemd[1]: Starting Simple CGI Server...
Sep 06 17:28:16 server systemd[1]: Started Simple CGI Server.
Sep 06 17:28:16 server systemd[1]: Starting Simple CGI Server...

Here are my config files:

nginx.conf -

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;


events {

worker_connections 1024;

}


http {

include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;

}

nagios.conf -

server {

listen 8000;
server_name nagios.node.com;

access_log /var/log/nginx/nagios.access.log;
error_log /var/log/nginx/nagios.error.log;

root /usr/local/nagios/share;
index index.php index.html;

auth_basic "Protected Site";
auth_basic_user_file .nagios;

location /stylesheets {

alias /usr/local/nagios/share/stylesheets;

}

location ~ .cgi$ {

root /usr/local/nagios/sbin/;
include fastcgi_params;
rewrite ^/nagios/cgi-bin/(.*).cgi /$1.cgi break;
fastcgi_param AUTH_USER $remote_user;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_param SCRIPT_FILENAME /usr/local/nagios/sbin/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;

}

location ~ .php$ {

include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm/nagios.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nagios/share$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;

}

location ~ (.*.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf))$ {

root /usr/local/nagios/share/;
rewrite ^/nagios/(.*) /$1 break;
access_log off; expires max;

}

}

fastcgi_params -

fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

fcgiwrap.socket -

ll /var/run/fcgiwrap.socket
-rw-rw---- 1 nginx nginx 0 Sep 6 17:27 /var/run/fcgiwrap.socket

php-fpm.d www.conf -

[www]

listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

user = nginx
group = nginx

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

slowlog = /var/log/php-fpm/www-slow.log

php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session

php-fpm.d nagios.conf -

[nagios]

;listen 127.0.0.1:9000
listen = /var/run/php-fpm/nagios.socket
listen.owner = nginx
listen.group = nginx
listen.mode=0660
listen.allowed_clients = 127.0.0.1

user = nagios
group = nagios

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

slowlog = /var/log/php-fpm/www-slow.log

php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/php-fpm/nagios-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session


As mentioned, I am very much a novice when it comes to php and fcgi. But it appears that the socket is not in a listening mode since a status check returns:

Active: inactive (dead)

Any guidance would be greatly appreciated, thanks in advance.

P.S. - I did not know how to format with blockquotes, etc so I apologize for running everything together..

HB

Shard nginx-rtmp containers with nginx stream module (no replies)

$
0
0
I want to let people publish on one url, for example:

rtmp://domain:1935/app/stream_name

In this url the stream_name could be a username or whatsoever. The stream_name is dynamic. Now I want to load balance this as following. I have a load balancer which works like:
```
stream {
upstream publish_rtmp_backend {
hash stream_name; <----------------------- Can't find a variable with the stream_name in it for the hash
server publish-rtmp:1935; <---------- hostname to dnsrr from docker service publish-rtmp
}

server {
listen 19350;
proxy_pass publish_rtmp_backend;
}
}
```
My docker-compose.yml for nginx-rtmp container looks like:
```
...
publish-rtmp:
image: publish-rtmp
deploy:
mode: replicated
replicas: 5
endpoint_mode: dnsrr
...
```
So I have 5 containers running with nginx-rtmp. Why can't I get the uri of the rtmp://domain:1935/app/stream_name url in the upstream block of the tcp load balancer. If this isn't possible what is a best practice of handling this.

Nginx - set env_var - typo3 config urls (no replies)

$
0
0
Hello,

Plesk Onyx, Nginx - FPM - without Apache, Typo3, realURL

I have read and googled a lot but i dont get it.
I try to set the additional nginx conf at the Plesk backend like the following, this works but things like "try_files" and so on doesnt work. Why, what i am doing wrong?

This works and i get nice URLs:
Code:
rewrite !\.(js|ico|gif|jpg|png|css|pdf|mov|mp3|eot|svg|ttf|woff|otf|txt|swf)$ /index.php break;
rewrite /typo3/$ /typo3/index.php break;
rewrite /$ /index.php break;
But things like this dont work (i get allways 404):

Code:
if (!-e $request_filename) {
set $test P;
}
if ($uri !~ ^/(plesk-stat|webstat|webstat-ssl|ftpstat|anon_ftpstat|awstats-icon|internal-nginx-static-location)) {
set $test "${test}C";
}
if ($test = PC) {
rewrite ^.*$ /index.php break;
}


OR something like:

try_files $uri $uri/ /index.php?$args;



The second and more important question is:
How can i set domain spezific enviroment variables? To use the TYPO3 Application Context?
I have read about things like the following but nothing works:
Code:
passenger_enabled on;
passenger_env_var $TYPO3_CONTEXT Development;
passenger_set_header TYPO3_CONTEXT Development;

I sit here now for days and dont get it to work, so please help me. :)
Thanks a lot.

P.S.: sry 4 my bad english. ;)

Basic nginx and rtmp setup (no replies)

$
0
0
Hi,

I am trying to setup nginx server where it will take video stream as input and re stream it using rtmp. This is my first time doing it and right now I am stuck as stream is not working.

Here's my nginx.config file:

rtmp {
server {
listen 1935;
chunk_size 4000;

application live {
live on;
pull rtmp://95.211.205.206/vod/sample.f4v name=test;
allow play all;
}
}
}

Now after that I try to open following in VLC player but streaming doesn't work.
rtmp://My_Server_IP/live/test

If you open the pull URL given above in VLC then it will work. Can you please check and let me know what's wrong in my code above?

The idea is simple. Take input stream and re stream it as it is.

send / ping another server from nginx (no replies)

$
0
0
I need the following configuration:
when the nginx is getting a request I need to do 3 things:
1. write a log entry
2. reply with a pixel gif file
3. in some instances I need to ping a different url like this: GET http://another_domain.com?a=1&b=2

number 3 is on top of the other two, so a reply with a gif is a must. I do not need to wait for a reply from another_domain.com this can be sent and forget...

At the moment I do it using php, but it takes to long and I want a way to do it directly from nginx.

Thanks

Reverse proxy to application (no replies)

$
0
0
Hi everybody

I have a synology and I want to link a subdomain to one on this application. This is the url I usually use to acces to this service :

192.168.0.17:5001//index.cgi?launchApp=SYNO.SDS.App.FileStation3.Instance&launchParam=openfile%3D%252FOliver%252F

But this i too long and I want to acces it directly this mydomaine.com

How should I configure the server ?

Thanks a lot for your help !

nginx+ mod_zip configuration (no replies)

$
0
0
If mod_zip gets such lines:
- 56320 /form1.doc form1.doc
- 55296 /form2.doc form2.doc
it works fine, but if (subdir added):
- 56320 /upload/form1.doc form1.doc
- 55296 /upload/form2.doc form2.doc
returns error: mod_zip: invalid file list from upstream while sending to client

Please help to fix that issue

nginx error during make (no replies)

$
0
0
I'm running fedora 25 32bit and I've downloaded nginx-1.10.1. I . I need the rtmp module working too so I also downloaded nginx-ts-module-master and I ran:

# ./configure --add-module=/home/packages/nginx-ts-module-master
the configure went ok but when I run make it stops with this error:

/home/packages/nginx-ts-module-master/src/ngx_ts_hls.c
/home/packages/nginx-ts-module-master/src/ngx_ts_hls.c: In function ‘ngx_ts_hls_set_slot’:
/home/packages/nginx-ts-module-master/src/ngx_ts_hls.c:988:28: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
hls->path->manager = ngx_ts_hls_file_manager;
^
cc1: all warnings being treated as errors
objs/Makefile:1175: recipe for target 'objs/addon/src/ngx_ts_hls.o' failed
make[1]: *** [objs/addon/src/ngx_ts_hls.o] Error 1
make[1]: Leaving directory '/home/packages/nginx-1.10.1'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

I'm new to nginx so I don't know where to go from here. Thanks for any help.
Viewing all 2931 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>