I tried to use Admin API via Postman to get token as per Authentication API
I’m getting an error 403, tippin some config error or something.
Here are my logs and configs
Blockquote
==> /var/log/nginx/error.log <==
2020/01/14 11:01:48 [error] 2846#2846: *94 access forbidden by rule, client: 192.168.120.67, server: _, request: “POST /api/rest/admin/auth HTTP/1.1”, host: “192.168.120.151”
Based on the previous topic discussions, I have followed the same as per below,
Nginx Configs (/etc/nginx/sites-enabled/yeti)
upstream ts {
server 127.0.0.1:80;
}
upstream ds {
server 127.0.0.1:80;
}
upstream yeti-unicorn {
server unix:/run/yeti/yeti-unicorn.sock;
}
#server {
listen 80;
server_name localhost;
root /opt/yeti-web;
access_log /var/log/nginx/yeti-web.access.log;
location / {
rewrite ^/(.*) https://localhost$request_uri? permanent;
}
#}
server {
listen 127.0.0.1:6666;
listen 192.168.120.151:6666;
server_name _;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Proxy-Port $proxy_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header HTTP_CLIENT_IP $remote_addr;
proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_connect_timeout 100;
proxy_send_timeout 20000;
proxy_read_timeout 20000;
proxy_buffer_size 32k;
proxy_buffers 8 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 640k;
allow 127.0.0.1;
deny all;
location /api/rest/system/jobs {
allow 127.0.0.1;
deny all;
proxy_pass http://yeti-unicorn;
}
location /api/rest/admin {
allow 127.0.0.1;
allow 192.168.120.151;
deny all;
proxy_pass http://yeti-unicorn;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
add_header 'Access-Control-Allow-Credentials' 'true';
}
location /api/rest/customer {
allow 127.0.0.1;
allow 192.168.120.151;
deny all;
proxy_pass http://yeti-unicorn;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
add_header 'Access-Control-Allow-Credentials' 'true';
}
I would appreciate it if you could assist with the API. I have also created a customer API, it is showing the same error as well