|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- worker_processes 1;
-
- events {
- worker_connections 1024;
- }
-
- http {
- include mime.types;
- default_type application/octet-stream;
-
- server {
- listen 80;
-
- location / {
- error_page 403 /403.html;
-
- set $test "";
- if ($uri ~ ^/api) {
- set $test "api";
- }
- rewrite ^/admin1/ $uri break;
- if ($uri ~ ^/([^/]*)/([^/]*)/(wiki|releases|issues)) {
- return 403;
- }
- rewrite ^/([^/]*)/([^/]*)/settings/(collaboration|branches) $uri break;
- if ($uri ~ ^/([^/]*)/([^/]*)/settings) {
- set $test "settings";
- }
- if ($request_method != "GET") {
- set $test "${test}_not-get";
- }
- if ($test = "settings_not-get") {
- return 403;
- }
- rewrite ^/api/v1/repos/[^/]*/[^/]*/markdown$ $uri break;
- rewrite ^/api/v1/markdown(/raw)?$ $uri break;
- if ($test = "api_not-get") {
- return 403;
- }
-
- root /usr/local/share/gitea/public;
-
- proxy_pass http://localhost:3000/;
- }
- }
- }
|