Welcome! Log In Create A New Profile

Advanced

serving files from /proc

Jérôme Loyet
December 12, 2023 10:18AM
Hello,

I'm trying to serve some files from /proc but nginx return a 0 bytes
content because the file size of many files in /proc/ tree is simply 0 by
design.

here is my sample conf file:
....
location = /route {
root /proc/net;
}

and the result of the corresponding curl:
> GET /route HTTP/1.1
> Host: 172.16.0.3:1513
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.23.1
< Date: Tue, 12 Dec 2023 15:08:00 GMT
< Content-Type: text/plain
< Content-Length: 0
< Last-Modified: Tue, 12 Dec 2023 15:08:00 GMT
< Connection: keep-alive
< ETag: "65787750-0"
< Accept-Ranges: bytes

is there a simple way to configure nginx to return the cotent of
/proc/net/route or any other file in /proc ?

thanks
regards
++ Jerome
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

serving files from /proc

Jérôme Loyet December 12, 2023 10:18AM

Re: serving files from /proc

Francis Daly December 12, 2023 12:44PM

Re: serving files from /proc

J Carter December 12, 2023 09:48PM

Re: serving files from /proc

J Carter December 12, 2023 10:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 102
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready