Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- server_name *.ag.wap3.com.ua;
- client_max_body_size 500M;
- client_body_buffer_size 500M;
- client_body_timeout 3600;
- keepalive_timeout 3600;
- location / {
- proxy_pass http://127.0.0.1:8080;
- proxy_set_header Host $host:80;
- proxy_set_header X-Real-IP $remote_addr;
- ##proxy_set_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Allow-Origin' "*";
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since';
- }
- }
- location /p/ {
- ## This must match the URI part related to the MD5 hash and expiration time.
- secure_link $arg_st,$arg_e;
- ## The MD5 hash is built from our secret token, the URI($path in PHP) and our expiration time.
- secure_link_md5 segredo$uri$arg_e;
- ## If the hash is incorrect then $secure_link is a null string.
- if ($secure_link = "") {
- return 403;
- }
- ## The current local time is greater than the specified expiration time.
- if ($secure_link = "0") {
- return 410;
- }
- ## If everything is ok $secure_link is 1.
- }
- location ~ ^/audio/track/play/image/(?<secure>[\w-]+,\d+)/(?<hentity>[\w-]+)/(?<hpath>[\w-]+)/(?<hyear>[\w-]+)/(?<hwidth>[\w-]+)/(?<hheight>[\w-]+)/(?<secured_stuff>.+)$ {
- proxy_set_header Host $host;
- ## This must match the URI part related to the MD5 hash and expiration time.
- secure_link $secure;
- # The MD5 hash is built from our secret token, the URI($path in PHP) and our expiration time.
- secure_link_md5 piypiyololo$secured_stuff$hpath$secure_link_expires;
- ## If the hash is incorrect then $secure_link is a null string.
- if ($secure_link = "") {
- return 403;
- }
- ## The current local time is greater than the specified expiration time.
- if ($secure_link = "0") {
- return 410;
- }
- ## If everything is ok $secure_link is 1.
- alias /web/$host/app/uploads/media/$hentity/$hpath/$hyear/$secured_stuff;
- try_files "" @404;
- image_filter resize $hwidth $hheight;
- }
- location ~ ^/audio/track/play/(?<secure>[\w-]+,\d+)/(?<hentity>[\w-]+)/(?<hpath>[\w-]+)/(?<hyear>[\w-]+)/(?<secured_stuff>.+)$ {
- proxy_set_header Host $host;
- ## This must match the URI part related to the MD5 hash and expiration time.
- secure_link $secure;
- # The MD5 hash is built from our secret token, the URI($path in PHP) and our expiration time.
- secure_link_md5 piypiyololo$secured_stuff$hpath$secure_link_expires;
- ## If the hash is incorrect then $secure_link is a null string.
- if ($secure_link = "") {
- return 403;
- }
- ## The current local time is greater than the specified expiration time.
- if ($secure_link = "0") {
- return 410;
- }
- ## If everything is ok $secure_link is 1.
- alias /web/$host/app/uploads/media/$hentity/$hpath/$hyear/$secured_stuff;
- }
- location ~ ^/profile/picture/([^/]+)/([^/]+)/(\d+)_(\d+)_(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $path1 $1;
- set $path2 $2;
- set $userId $3;
- set $width $4;
- set $height $5;
- set $ext $6;
- alias /web/$host/app/uploads/media/userprofile/$1/$2/$userId$ext;
- try_files "" @404;
- image_filter resize $width $height;
- }
- location ~ ^/banner/media/([^/]+)/([^/]+)/(\d+)_(\d+)_(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $path1 $1;
- set $path2 $2;
- set $userId $3;
- set $width $4;
- set $height $5;
- set $ext $6;
- alias /web/$host/app/uploads/media/banner/$1/$2/$userId$ext;
- try_files "" @404;
- image_filter resize $width $height;
- }
- location ~ ^/jingle/media/([^/]+)/([^/]+)/(\d+)_(\d+)_(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $path1 $1;
- set $path2 $2;
- set $id $3;
- set $width $4;
- set $height $5;
- set $ext $6;
- alias /web/$host/app/uploads/media/jingle/$1/$2/$id$ext;
- try_files "" @404;
- image_filter resize $width $height;
- }
- location ~ ^/partner/media/([^/]+)/([^/]+)/(\d+)_(\d+)_(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $path1 $1;
- set $path2 $2;
- set $userId $3;
- set $width $4;
- set $height $5;
- set $ext $6;
- alias /web/$host/app/uploads/media/partner/$1/$2/$userId$ext;
- try_files "" @404;
- image_filter resize $width $height;
- }
- location ~ ^/special/media/([^/]+)/([^/]+)/(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $path1 $1;
- set $path2 $2;
- set $id $3;
- set $ext $4;
- alias /web/$host/app/uploads/media/speczone/$1/$2/$id$ext;
- try_files "" @404;
- }
- location ~ ^/special/audio/([^/]+)/([^/]+)/(\d+)_(\d+)_(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $path1 $1;
- set $path2 $2;
- set $id $3;
- set $width $4;
- set $height $5;
- set $ext $6;
- alias /web/$host/app/uploads/media/speczone_audio/$1/$2/$id$ext;
- try_files "" @404;
- image_filter resize $width $height;
- }
- location @404 { return 404; }
- types {
- application/vnd.ms-fontobject eot;
- application/font-woff woff;
- font/otf otf;
- font/ttf ttf;
- audio/mpeg mp3;
- }
- location ~ ^/media/([^/]+)/([^/]+)/([^/]+)/(\d+)/(\d+)/(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $context $1;
- set $path1 $2;
- set $path2 $3;
- set $width $4;
- set $height $5;
- set $id $6;
- set $ext $7;
- alias /web/$host/server/app/uploads/media/$1/$2/$3/$id$ext;
- try_files "" @404;
- image_filter_buffer 10M;
- image_filter resize $width $height;
- }
- ##QUIZ
- # location ~ ^/media/([^/]+)/([^/]+)/([^/]+)/(\d+)(.*\.(?:mp3|ogg))$ {
- # proxy_set_header Host $host;
- # set $context $1;
- # set $path1 $2;
- # set $path2 $3;
- # set $id $4;
- # set $ext $5;
- #
- # alias /web/$host/server/app/uploads/media/$1/$2/$3/$id$ext;
- # try_files "" @404;
- # }
- ##House
- location ~ ^/storage/image/([^/]+)/([^/]+)/([^/]+)/(\d+)/(\d+)/(\d+)(.*\.(?:jpg|jpeg|gif|png))$ {
- proxy_set_header Host $host;
- set $context $1;
- set $path1 $2;
- set $path2 $3;
- set $width $4;
- set $height $5;
- set $id $6;
- set $ext $7;
- alias /web/$host/app/storage/$1/$2/$3/$id$ext;
- try_files "" @404;
- image_filter resize $width $height;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement